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
8ba423bf
Commit
8ba423bf
authored
May 17, 2021
by
Doan Andreas Nathanael
Browse files
[REFACTOR] fix lint angry
parent
243b1fa3
Pipeline
#77673
canceled with stages
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/scenes/questionnaire/ProfileDietRecommendation/index.tsx
View file @
8ba423bf
...
...
@@ -19,7 +19,6 @@ import { retrieveClientListApi } from 'services/profiles';
import
{
Client
}
from
'
services/profiles/models
'
;
import
{
submitDietRecommendationByIdApi
}
from
'
services/dietRecommendation
'
;
import
*
as
ROUTES
from
'
constants/routes
'
;
import
{
user
}
from
'
services/auth/urls
'
;
interface
Params
{
name
:
string
;
...
...
@@ -31,7 +30,7 @@ const ProfileDietRecommendation: FC = () => {
const
navigation
=
useNavigation
();
const
[
fileError
,
setFileError
]
=
useState
(
false
);
const
[
file
,
setFile
]
=
useState
<
DocumentPickerResponse
>
();
const
{
name
,
id
}
=
route
.
params
as
Params
;
const
{
name
:
userName
,
id
}
=
route
.
params
as
Params
;
const
{
isLoading
,
data
:
clients
=
[]
}
=
useApi
(
retrieveClientListApi
);
const
{
...
...
@@ -75,7 +74,7 @@ const ProfileDietRecommendation: FC = () => {
Toast
.
show
({
type
:
'
success
'
,
text1
:
'
Rekomendasi berhasil dikirim
'
,
text2
:
`File rencana menu serta saran gizi & gaya hidup berhasil dikirim ke client
${
n
ame
}
.`
,
text2
:
`File rencana menu serta saran gizi & gaya hidup berhasil dikirim ke client
${
userN
ame
}
.`
,
});
navigation
.
navigate
(
ROUTES
.
clientProfileNutritionist
,
{
id
:
client
.
diet_questionnaire_id
,
...
...
@@ -114,7 +113,7 @@ const ProfileDietRecommendation: FC = () => {
return
(
<
ScrollView
style
=
{
layoutStyles
}
>
<
HeadingLarge
text
=
{
`Rekomendasi untuk
${
n
ame
}
`
}
/>
<
HeadingLarge
text
=
{
`Rekomendasi untuk
${
userN
ame
}
`
}
/>
<
Section
>
<
BodyMedium
text
=
"Rencana porsi makan dan menu *"
/>
...
...
src/scenes/questionnaire/ReadOnlyDietProfile/index.test.tsx
View file @
8ba423bf
import
React
from
'
react
'
;
import
{
render
,
waitFor
}
from
'
utils/testing
'
;
import
{
render
}
from
'
utils/testing
'
;
import
*
as
ROUTES
from
'
constants/routes
'
;
import
axios
from
'
axios
'
;
import
ReadOnlyDietProfile
from
'
.
'
;
import
{
mockDietQuestionnaire
}
from
'
__mocks__/dietQuestionnaire
'
;
jest
.
useFakeTimers
();
jest
.
mock
(
'
axios
'
);
const
mockAxios
=
axios
as
jest
.
Mocked
<
typeof
axios
>
;
describe
(
'
ReadOnlyDietProfile
'
,
()
=>
{
it
(
'
renders correctly
'
,
()
=>
{
render
(<
ReadOnlyDietProfile
/>,
ROUTES
.
clientProfileNutritionist
,
{
...
...
src/services/dietRecommendation/index.ts
View file @
8ba423bf
import
{
api
,
RequestMethod
,
ApiResponse
}
from
'
../api
'
;
import
*
as
apiUrls
from
'
./urls
'
;
import
{
DietRecommendationRequest
,
DietRecommendationResponse
,
}
from
'
./models
'
;
import
{
DietRecommendationResponse
}
from
'
./models
'
;
export
const
retrieveDietRecommendationApi
=
():
ApiResponse
<
DietRecommendationResponse
[]
...
...
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