From 4e88485502cf04a9f6ad1db711ecedf34086ee69 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 27 Nov 2025 16:10:25 +0800 Subject: [PATCH] Added checking of Pops status --- src/utils/functions/statusPopsApi.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/utils/functions/statusPopsApi.ts diff --git a/src/utils/functions/statusPopsApi.ts b/src/utils/functions/statusPopsApi.ts new file mode 100644 index 0000000..6e9891e --- /dev/null +++ b/src/utils/functions/statusPopsApi.ts @@ -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 + } +}