diff --git a/src/utils/functions/postApi.ts b/src/utils/functions/postApi.ts new file mode 100644 index 0000000..7bda182 --- /dev/null +++ b/src/utils/functions/postApi.ts @@ -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 + } +}