Added checking of Pops status
This commit is contained in:
parent
b908e5a99e
commit
4e88485502
1 changed files with 13 additions and 0 deletions
13
src/utils/functions/statusPopsApi.ts
Normal file
13
src/utils/functions/statusPopsApi.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { ofetch } from 'ofetch';
|
||||
|
||||
const STATUS = "https://gateway.davaocity.gov.ph/api/pops/statusOP.ashx?oprefid="
|
||||
|
||||
export default async (application: string) => {
|
||||
try {
|
||||
const fetch = await ofetch(STATUS + application, { parseResponse: JSON.parse, retry: 3, retryDelay: 500, retryStatusCodes: [400, 404, 405, 500, 502] })
|
||||
const result = fetch
|
||||
return result
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue