From 7f60d5a3476d7ad029222e57358ea3010b728a1e Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Sat, 7 Mar 2026 11:30:03 +0800 Subject: [PATCH] Revised statusPops --- src/utils/functions/statusPopsApi.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/utils/functions/statusPopsApi.ts b/src/utils/functions/statusPopsApi.ts index 6e9891e..dae6f1a 100644 --- a/src/utils/functions/statusPopsApi.ts +++ b/src/utils/functions/statusPopsApi.ts @@ -1,10 +1,15 @@ -import { ofetch } from 'ofetch'; +import { ofetch } from 'ofetch' -const STATUS = "https://gateway.davaocity.gov.ph/api/pops/statusOP.ashx?oprefid=" +// const STATUS = 'https://gateway.davaocity.gov.ph/api/pops/statusOP.ashx?oprefid=' +const API = import.meta.env.VITE_BACKEND 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 fetch = await ofetch(STATUS + application, { parseResponse: JSON.parse, retry: 3, retryDelay: 500, retryStatusCodes: [400, 404, 405, 500, 502] }) + // const result = fetch + // return result + + const fetch = await ofetch(API + `pops/statusOP/${application}/check-status-pops`, { parseResponse: JSON.parse, retry: 3, retryDelay: 500, retryStatusCodes: [400, 404, 405, 500, 502] }) const result = fetch return result } catch {