Added post api function

This commit is contained in:
Patrick Alvin Alcala 2025-11-04 16:53:35 +08:00
parent 9ffae4ed03
commit 321109e064

View file

@ -0,0 +1,22 @@
import { ofetch } from 'ofetch'
import { SHA3 } from 'crypto-js'
const API = import.meta.env.VITE_BACKEND
export default async (api: string, body: Object) => {
try {
await ofetch(API + api, {
headers: {
Accept: 'application/json',
'Cache-Control': 'no-cache',
'OCBO-Token': '',
},
method: 'POST',
body: body,
})
return true
} catch {
return false
}
}