New fetch function

This commit is contained in:
Patrick Alvin Alcala 2025-10-21 11:44:10 +08:00
parent 65b5237169
commit d44c080a85

View file

@ -0,0 +1,13 @@
import { ofetch } from 'ofetch'
const API = import.meta.env.VITE_BACKEND
export default async (api: string) => {
try {
const fetch = await ofetch(API + api)
const result = fetch.result
return result
} catch {
return false
}
}