From 6fb1b3b3ec887096731f0dd73dbe00e1ca4f51e0 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Tue, 25 Nov 2025 17:11:00 +0800 Subject: [PATCH] Added voidApi --- src/utils/functions/voidApi.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/utils/functions/voidApi.ts diff --git a/src/utils/functions/voidApi.ts b/src/utils/functions/voidApi.ts new file mode 100644 index 0000000..904bf1b --- /dev/null +++ b/src/utils/functions/voidApi.ts @@ -0,0 +1,13 @@ +import { ofetch } from 'ofetch' + +const VOID = "https://gateway.davaocity.gov.ph/api/pops/voidOP.ashx?oprefid=" + +export default async (application: string) => { + try { + const fetch = await ofetch(VOID + application, { parseResponse: JSON.parse, retry: 3, retryDelay: 500, retryStatusCodes: [400, 404, 405, 500, 502] }) + const result = fetch + return result + } catch { + return null + } +}