Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2021
Kelas D
PT Gizi Sehat - Dietela
Dietela Mobile
Commits
c1468087
Commit
c1468087
authored
Jun 01, 2021
by
wulanmantiri
Browse files
[GREEN] Add API for diet progress, adjust weekly report form fields
parent
316a3d1c
Pipeline
#80667
passed with stages
in 11 minutes and 1 second
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/constants/weeklyReport.ts
View file @
c1468087
...
...
@@ -10,21 +10,21 @@ export const dietReportTextFields: { [_: string]: TextFieldSchema[] } = {
dietReportPage1
:
[
{
label
:
'
Berat Badan (kg)
'
,
placeholder
:
'
Masukkan yang terakhir diukur
'
,
placeholder
:
'
Masukkan
berat badan
yang terakhir diukur
'
,
name
:
'
weight
'
,
required
:
true
,
keyboardType
:
'
numeric
'
,
},
{
label
:
'
Tinggi Badan (cm)
'
,
placeholder
:
'
Masukkan yang terakhir diukur
'
,
placeholder
:
'
Masukkan
tinggi badan
yang terakhir diukur
'
,
name
:
'
height
'
,
required
:
true
,
keyboardType
:
'
numeric
'
,
},
{
label
:
'
Lingkar Pinggang (cm)
'
,
placeholder
:
'
Masukkan yang terakhir diukur
'
,
placeholder
:
'
Masukkan
lingkar pinggang
yang terakhir diukur
'
,
name
:
'
waist_size
'
,
required
:
true
,
keyboardType
:
'
numeric
'
,
...
...
@@ -45,6 +45,7 @@ export const dietReportTextFields: { [_: string]: TextFieldSchema[] } = {
{
label
:
'
Dalam 1 minggu terakhir, apa saja yang sudah bisa Anda pelajari dari program ini?
'
,
placeholder
:
'
Masukkan pelajaran minggu ini
'
,
name
:
'
lesson_learned
'
,
required
:
true
,
multiline
:
true
,
...
...
@@ -54,6 +55,7 @@ export const dietReportTextFields: { [_: string]: TextFieldSchema[] } = {
label
:
`Silahkan sampaikan disini, jika Anda mempunyai:
(1) kendala, keluhan atau kesulitan dalam mengikuti program, atau
(2) masukan, saran, dan komplain terkait layanan sejauh ini.`
,
placeholder
:
'
Masukkan keluh kesah atau saran bagi Dietela
'
,
name
:
'
problem_faced_and_feedbacks
'
,
multiline
:
true
,
},
...
...
src/services/progress/index.ts
View file @
c1468087
import
{
api
,
RequestMethod
,
ApiResponse
}
from
'
../api
'
;
import
*
as
apiUrls
from
'
./urls
'
;
import
{
UserReportResponse
}
from
'
./models
'
;
import
{
UserReportResponse
,
UserReportRequest
}
from
'
./models
'
;
export
const
retrieveUserReportById
=
(
i
d
:
number
,
clientI
d
:
number
,
):
ApiResponse
<
UserReportResponse
[]
>
=>
{
return
api
(
RequestMethod
.
GET
,
apiUrls
.
userReportById
(
id
));
return
api
(
RequestMethod
.
GET
,
apiUrls
.
userReportByClientId
(
clientId
));
};
export
const
createUserReportApi
=
(
payload
:
UserReportRequest
,
):
ApiResponse
<
UserReportResponse
>
=>
{
return
api
(
RequestMethod
.
POST
,
apiUrls
.
userReport
,
payload
);
};
src/services/progress/urls.ts
View file @
c1468087
export
const
progress
=
'
progress/
'
;
export
const
userReportById
=
(
id
:
number
)
=>
`
${
progress
}${
id
}
`
;
export
const
userReport
=
`
${
progress
}
user_report/`
;
export
const
userReportByClientId
=
(
id
:
number
)
=>
`
${
userReport
}
?client_id=
${
id
}
`
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment