feat: update API paths to v1 and remove old path references for consistency
This commit is contained in:
@@ -2,11 +2,9 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/diagnose-prb'
|
||||
const pathOld = '/api/vclaim/v1/reference/diagnose-prb'
|
||||
const name = 'diagnose-referral'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
const url = !isNew ? pathOld : path
|
||||
const url = path
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/diagnose'
|
||||
const pathOld = '/api/vclaim/v1/reference/diagnose'
|
||||
const name = 'diagnose'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params && params?.diagnosa) {
|
||||
url += `/${params.diagnosa}`
|
||||
delete params.diagnosa
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/responsible-doctor'
|
||||
const pathOld = '/api/vclaim/v1/reference/responsible-doctor'
|
||||
const name = 'responsible-doctor'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params?.serviceType) {
|
||||
url += `/${params.serviceType}`
|
||||
delete params.serviceType
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/healthcare'
|
||||
const pathOld = '/api/vclaim/v1/reference/healthcare'
|
||||
const name = 'healthcare'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params?.healthcare) {
|
||||
url += `/${params.healthcare}`
|
||||
delete params.healthcare
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/medicine'
|
||||
const pathOld = '/api/vclaim/v1/reference/medicine'
|
||||
const name = 'medicine'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
const url = !isNew ? pathOld : path
|
||||
const url = path
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/member'
|
||||
const pathOld = '/api/vclaim/v1/member'
|
||||
const name = 'member'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params?.number && params.mode === 'by-identity') {
|
||||
url += `/nik/${params.number}/${params.date}`
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/monitoring/hist'
|
||||
const pathOld = '/api/vclaim/v1/monitoring/hist'
|
||||
const name = 'monitoring-history'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params && params?.cardNumber) {
|
||||
url += `/${params.cardNumber}/${params.startDate}/${params.endDate}`
|
||||
delete params.cardNumber
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/monitoring/visit'
|
||||
const pathOld = '/api/vclaim/v1/monitoring/visit'
|
||||
const name = 'monitoring-visit'
|
||||
|
||||
export async function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params?.date && params.serviceType) {
|
||||
url += `/${params.date}/${params.serviceType}`
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/referral'
|
||||
const pathOld = '/api/vclaim-swagger/Rujukan/RS'
|
||||
const name = 'reference-hospital-letter' // 'rujukan-rumah-sakit'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params?.letterNumber) {
|
||||
url += `/${params.letterNumber}`
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/regency'
|
||||
const pathOld = '/api/vclaim/v1/reference/regency'
|
||||
const name = 'cities'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params?.province) {
|
||||
url += `/${params.province}`
|
||||
delete params.province
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/district'
|
||||
const pathOld = '/api/vclaim/v1/reference/district'
|
||||
const name = 'districts'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params?.city) {
|
||||
url += `/${params.city}`
|
||||
delete params.city
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/province'
|
||||
const pathOld = '/api/vclaim/v1/reference/province'
|
||||
const name = 'provinces'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
const url = path
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/v1/reference/unit'
|
||||
const pathOld = '/api/vclaim/v1/reference/unit'
|
||||
const name = 'unit'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
const isNew = true
|
||||
let url = !isNew ? pathOld : path
|
||||
let url = path
|
||||
if (params?.unitCode) {
|
||||
url += `/${params.unitCode}`
|
||||
delete params.unitCode
|
||||
|
||||
@@ -10,10 +10,10 @@ export default defineEventHandler(async (event) => {
|
||||
const apiVclaim = config.public.VCLAIM
|
||||
const apiVclaimSwagger = config.public.VCLAIM_SWAGGER
|
||||
const pathname = url.pathname.replace(/^\/api/, '')
|
||||
const isVclaim = pathname.includes('/vclaim')
|
||||
const isVclaim = pathname.includes('/vclaim') && !pathname.includes('/vclaim-sep')
|
||||
|
||||
let targetUrl = apiOrigin + pathname + (url.search || '')
|
||||
if (pathname.includes('/vclaim')) {
|
||||
if (pathname.includes('/vclaim') && !pathname.includes('/vclaim-sep')) {
|
||||
targetUrl = apiVclaim + pathname.replace('/vclaim', '') + (url.search || '')
|
||||
}
|
||||
if (pathname.includes('/vclaim-swagger')) {
|
||||
|
||||
Reference in New Issue
Block a user