Compare commits
No commits in common. "7f60d5a3476d7ad029222e57358ea3010b728a1e" and "e79646a61367ef01808e75a75f8621d4c43f8151" have entirely different histories.
7f60d5a347
...
e79646a613
4 changed files with 18 additions and 68 deletions
|
|
@ -3,7 +3,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
@ -1604,50 +1603,6 @@ func connect() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
router.GET("/api/pops/statusOP/:data/check-status-pops", func(c *gin.Context) {
|
|
||||||
data := c.Param("data")
|
|
||||||
url := "https://gateway.davaocity.gov.ph/api/pops/statusOP.ashx?oprefid=" + data
|
|
||||||
|
|
||||||
resp, err := http.Get(url)
|
|
||||||
if err != nil {
|
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
c.AbortWithError(http.StatusInternalServerError, err)
|
|
||||||
c.String(http.StatusInternalServerError, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
c.Data(resp.StatusCode, "application/json", body)
|
|
||||||
})
|
|
||||||
|
|
||||||
router.GET("/api/pops/voidOP/:data/void-pops", func(c *gin.Context) {
|
|
||||||
data := c.Param("data")
|
|
||||||
url := "https://gateway.davaocity.gov.ph/api/pops/voidOP.ashx?oprefid=" + data
|
|
||||||
|
|
||||||
resp, err := http.Get(url)
|
|
||||||
if err != nil {
|
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
c.AbortWithError(http.StatusInternalServerError, err)
|
|
||||||
c.String(http.StatusInternalServerError, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
c.Data(resp.StatusCode, "application/json", body)
|
|
||||||
})
|
|
||||||
|
|
||||||
router.POST("/api/post-registration", middleware.TokenChecker(), func(c *gin.Context) {
|
router.POST("/api/post-registration", middleware.TokenChecker(), func(c *gin.Context) {
|
||||||
type RegistrationData struct {
|
type RegistrationData struct {
|
||||||
Data int `json:"data"`
|
Data int `json:"data"`
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
"@biomejs/biome": "^2.4.6",
|
"@biomejs/biome": "^2.4.6",
|
||||||
"@nanostores/solid": "^1.1.1",
|
"@nanostores/solid": "^1.1.1",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/node": "^24.12.0",
|
"@types/node": "^24.11.2",
|
||||||
"sass-embedded": "^1.97.3",
|
"sass-embedded": "^1.97.3",
|
||||||
"typescript": "~5.8.3",
|
"typescript": "~5.8.3",
|
||||||
"vite": "^7.3.1",
|
"vite": "^7.3.1",
|
||||||
|
|
|
||||||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
|
|
@ -85,8 +85,8 @@ importers:
|
||||||
specifier: ^4.2.2
|
specifier: ^4.2.2
|
||||||
version: 4.2.2
|
version: 4.2.2
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^24.12.0
|
specifier: ^24.11.2
|
||||||
version: 24.12.0
|
version: 24.11.2
|
||||||
sass-embedded:
|
sass-embedded:
|
||||||
specifier: ^1.97.3
|
specifier: ^1.97.3
|
||||||
version: 1.97.3
|
version: 1.97.3
|
||||||
|
|
@ -95,13 +95,13 @@ importers:
|
||||||
version: 5.8.3
|
version: 5.8.3
|
||||||
vite:
|
vite:
|
||||||
specifier: ^7.3.1
|
specifier: ^7.3.1
|
||||||
version: 7.3.1(@types/node@24.12.0)(sass-embedded@1.97.3)(sass@1.97.3)
|
version: 7.3.1(@types/node@24.11.2)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||||
vite-plugin-compression2:
|
vite-plugin-compression2:
|
||||||
specifier: ^2.5.0
|
specifier: ^2.5.0
|
||||||
version: 2.5.0(rollup@4.52.1)
|
version: 2.5.0(rollup@4.52.1)
|
||||||
vite-plugin-solid:
|
vite-plugin-solid:
|
||||||
specifier: ^2.11.10
|
specifier: ^2.11.10
|
||||||
version: 2.11.10(solid-js@1.9.11)(vite@7.3.1(@types/node@24.12.0)(sass-embedded@1.97.3)(sass@1.97.3))
|
version: 2.11.10(solid-js@1.9.11)(vite@7.3.1(@types/node@24.11.2)(sass-embedded@1.97.3)(sass@1.97.3))
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
|
|
@ -1084,8 +1084,8 @@ packages:
|
||||||
'@types/node@16.9.1':
|
'@types/node@16.9.1':
|
||||||
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
|
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
|
||||||
|
|
||||||
'@types/node@24.12.0':
|
'@types/node@24.11.2':
|
||||||
resolution: {integrity: sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==}
|
resolution: {integrity: sha512-HTsxyfkxTNxOXBsEdgIOzbMgBjDGPvkTfw0B1m09j1LFPk8u3tSL8SNBRTSc381wXXX/Wp93qPi1kQXwnWuHgA==}
|
||||||
|
|
||||||
'@types/pako@2.0.4':
|
'@types/pako@2.0.4':
|
||||||
resolution: {integrity: sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==}
|
resolution: {integrity: sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==}
|
||||||
|
|
@ -2762,7 +2762,7 @@ snapshots:
|
||||||
|
|
||||||
'@types/node@16.9.1': {}
|
'@types/node@16.9.1': {}
|
||||||
|
|
||||||
'@types/node@24.12.0':
|
'@types/node@24.11.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: 7.16.0
|
undici-types: 7.16.0
|
||||||
|
|
||||||
|
|
@ -3516,7 +3516,7 @@ snapshots:
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- rollup
|
- rollup
|
||||||
|
|
||||||
vite-plugin-solid@2.11.10(solid-js@1.9.11)(vite@7.3.1(@types/node@24.12.0)(sass-embedded@1.97.3)(sass@1.97.3)):
|
vite-plugin-solid@2.11.10(solid-js@1.9.11)(vite@7.3.1(@types/node@24.11.2)(sass-embedded@1.97.3)(sass@1.97.3)):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/core': 7.28.4
|
'@babel/core': 7.28.4
|
||||||
'@types/babel__core': 7.20.5
|
'@types/babel__core': 7.20.5
|
||||||
|
|
@ -3524,12 +3524,12 @@ snapshots:
|
||||||
merge-anything: 5.1.7
|
merge-anything: 5.1.7
|
||||||
solid-js: 1.9.11
|
solid-js: 1.9.11
|
||||||
solid-refresh: 0.6.3(solid-js@1.9.11)
|
solid-refresh: 0.6.3(solid-js@1.9.11)
|
||||||
vite: 7.3.1(@types/node@24.12.0)(sass-embedded@1.97.3)(sass@1.97.3)
|
vite: 7.3.1(@types/node@24.11.2)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||||
vitefu: 1.1.1(vite@7.3.1(@types/node@24.12.0)(sass-embedded@1.97.3)(sass@1.97.3))
|
vitefu: 1.1.1(vite@7.3.1(@types/node@24.11.2)(sass-embedded@1.97.3)(sass@1.97.3))
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
vite@7.3.1(@types/node@24.12.0)(sass-embedded@1.97.3)(sass@1.97.3):
|
vite@7.3.1(@types/node@24.11.2)(sass-embedded@1.97.3)(sass@1.97.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild: 0.27.2
|
esbuild: 0.27.2
|
||||||
fdir: 6.5.0(picomatch@4.0.3)
|
fdir: 6.5.0(picomatch@4.0.3)
|
||||||
|
|
@ -3538,14 +3538,14 @@ snapshots:
|
||||||
rollup: 4.52.1
|
rollup: 4.52.1
|
||||||
tinyglobby: 0.2.15
|
tinyglobby: 0.2.15
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 24.12.0
|
'@types/node': 24.11.2
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
sass: 1.97.3
|
sass: 1.97.3
|
||||||
sass-embedded: 1.97.3
|
sass-embedded: 1.97.3
|
||||||
|
|
||||||
vitefu@1.1.1(vite@7.3.1(@types/node@24.12.0)(sass-embedded@1.97.3)(sass@1.97.3)):
|
vitefu@1.1.1(vite@7.3.1(@types/node@24.11.2)(sass-embedded@1.97.3)(sass@1.97.3)):
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
vite: 7.3.1(@types/node@24.12.0)(sass-embedded@1.97.3)(sass@1.97.3)
|
vite: 7.3.1(@types/node@24.11.2)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||||
|
|
||||||
webworkify@1.5.0: {}
|
webworkify@1.5.0: {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,10 @@
|
||||||
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) => {
|
export default async (application: string) => {
|
||||||
try {
|
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
|
const result = fetch
|
||||||
return result
|
return result
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue