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
2020
PPL-C
PPTI-Mobile Apps Monitoring Wabah Tuberkolosis
Neza-Mobile
Commits
5f5cdf27
Commit
5f5cdf27
authored
Apr 23, 2020
by
Irwanto
Browse files
Merge branch 'pbi-monitoring-case' into 'staging'
PBI monitoring case See merge request
!25
parents
4f4c24b0
92efd513
Pipeline
#43019
passed with stages
in 12 minutes and 42 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/scenes/ContactInvestigationFormStep4/index.tsx
View file @
5f5cdf27
...
...
@@ -162,7 +162,13 @@ const ContactInvestigationFormStep4 = () => {
const
investigationResponse
=
formData
.
is_edit
?
await
main
.
editInvestigationCase
(
investigationCaseData
,
formData
.
id
)
:
await
main
.
createInvestigationCase
(
investigationCaseData
);
console
.
log
(
investigationResponse
)
if
(
!
formData
.
is_edit
&&
form
.
fields
.
is_referral_needed
.
value
)
{
await
main
.
createMonitoringCase
({
"
investigation_case
"
:
investigationResponse
.
data
.
id
,
})
}
setIsLoading
(
false
);
global
.
setCache
(
initialCacheState
);
navigation
.
navigate
(
'
contact-investigation-finish
'
);
...
...
src/scenes/MonitoringMedicalCheck/index.tsx
View file @
5f5cdf27
...
...
@@ -30,7 +30,10 @@ const MonitoringMedicalCheck = () => {
outcome
:
form
.
fields
.
checked
.
value
?
form
.
fields
.
check_result
.
value
:
null
},
global
.
cache
.
monitoringCaseFormData
.
investigation_case
.
id
);
const
checkDate
:
Date
=
form
.
fields
.
check_date
.
value
;
const
checkDateString
=
checkDate
.
toISOString
().
slice
(
0
,
10
);
const
monitoringResp
=
await
global
.
services
.
main
.
updateMonitoringCase
({
checking_date
:
form
.
fields
.
checked
.
value
?
checkDateString
:
null
,
is_checked
:
form
.
fields
.
checked
.
value
,
},
global
.
cache
.
monitoringCaseFormData
.
id
);
...
...
src/scenes/MonitoringMedicalResume/index.tsx
View file @
5f5cdf27
...
...
@@ -36,7 +36,6 @@ const MonitoringMedicalResume = () => {
medication_outcome
:
form
.
fields
.
result
.
value
},
global
.
cache
.
monitoringCaseFormData
.
id
);
console
.
log
(
resp
)
if
(
resp
.
status
==
200
)
{
navigation
.
navigate
(
'
monitoring-finish
'
);
}
...
...
src/services/hooks/useMainService/index.tsx
View file @
5f5cdf27
...
...
@@ -188,6 +188,18 @@ export default function useMainService(token: string) {
return
fetchWithAuthentication
(
endpoint
.
slice
(
0
,
-
1
),
Method
.
GET
);
}
async
function
createMonitoringCase
(
body
:
object
)
{
const
endPoint
=
END_POINTS
.
MONITORING_CASES
([
null
,
null
,
])
return
fetchWithAuthentication
(
endPoint
,
Method
.
POST
,
body
,
);
}
async
function
listMonitoringCases
(
page
:
number
)
{
if
(
page
===
1
)
{
const
endpoint
=
END_POINTS
.
MONITORING_CASES
([
null
,
null
]);
...
...
@@ -233,6 +245,7 @@ export default function useMainService(token: string) {
listPositiveCases
,
filterPositiveCase
,
// Monitoring Case
createMonitoringCase
,
listMonitoringCases
,
filterMonitoringCase
,
updateMonitoringCase
,
...
...
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