feat(sep): add vclaim region service + fix server req
This commit is contained in:
No files matched your search
@@ -7,6 +7,7 @@ import type { PatientEntity } from '~/models/patient'
|
|||||||
|
|
||||||
// Services
|
// Services
|
||||||
import { getPatientDetail, getPatients } from '~/services/patient.service'
|
import { getPatientDetail, getPatients } from '~/services/patient.service'
|
||||||
|
import { getList as getDiagnoseReferralList } from '~/services/vclaim-diagnose-referral.service'
|
||||||
import { getList as getVclaimMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
import { getList as getVclaimMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
||||||
import { getList as getVclaimMonitoringHistoryList } from '~/services/vclaim-monitoring-history.service'
|
import { getList as getVclaimMonitoringHistoryList } from '~/services/vclaim-monitoring-history.service'
|
||||||
|
|
||||||
@@ -158,6 +159,11 @@ function handleEvent(value: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getDiagnoseReferralList().then(
|
||||||
|
(value) => {
|
||||||
|
console.log('value:', value)
|
||||||
|
},
|
||||||
|
)
|
||||||
getVclaimMonitoringHistoryList({ nop: '0002078925513', tglawal: '2025-07-20', tglakhir: '2025-10-10' }).then(
|
getVclaimMonitoringHistoryList({ nop: '0002078925513', tglawal: '2025-07-20', tglakhir: '2025-10-10' }).then(
|
||||||
(value) => {
|
(value) => {
|
||||||
console.log('value:', value)
|
console.log('value:', value)
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// Base
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const path = '/api/vclaim/cities'
|
||||||
|
const name = 'cities'
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
let url = path
|
||||||
|
if (params?.province) {
|
||||||
|
url += `/${params.province}`
|
||||||
|
delete params.province
|
||||||
|
}
|
||||||
|
return base.getList(url, params, name)
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// Base
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const path = '/api/vclaim/districts'
|
||||||
|
const name = 'districts'
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
let url = path
|
||||||
|
if (params?.city) {
|
||||||
|
url += `/${params.city}`
|
||||||
|
delete params.city
|
||||||
|
}
|
||||||
|
return base.getList(url, params, name)
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// Base
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const path = '/api/vclaim/provinces'
|
||||||
|
const name = 'provinces'
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
+10
-3
@@ -27,8 +27,10 @@ export default defineEventHandler(async (event) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const forwardHeaders = new Headers()
|
const forwardHeaders = new Headers()
|
||||||
if (headers['content-type']) forwardHeaders.set('Content-Type', headers['content-type'])
|
if (!isVclaim) {
|
||||||
if (!isVclaim) forwardHeaders.set('Authorization', `Bearer ${bearer}`)
|
if (headers['content-type']) forwardHeaders.set('Content-Type', headers['content-type'])
|
||||||
|
forwardHeaders.set('Authorization', `Bearer ${bearer}`)
|
||||||
|
}
|
||||||
|
|
||||||
let body: any
|
let body: any
|
||||||
if (['POST', 'PATCH'].includes(method!)) {
|
if (['POST', 'PATCH'].includes(method!)) {
|
||||||
@@ -48,7 +50,12 @@ export default defineEventHandler(async (event) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (isVclaim) {
|
if (isVclaim) {
|
||||||
console.log('res:', res)
|
const resClone = res.clone()
|
||||||
|
return {
|
||||||
|
status: resClone.status,
|
||||||
|
headers: resClone.headers,
|
||||||
|
body: await resClone.json(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
Reference in New Issue
Block a user