import { ofetch } from "ofetch"; const httpFetchClient = { get: async (url: string, headers: Record) => { const response = await ofetch(url, { method: "GET", headers, }); return response; }, post: async (url: string, body: JSON, headers: Record) => { const response = await ofetch(url, { method: "POST", headers, body: JSON.stringify(body), }); return response; }, put: async (url: string, body: JSON, headers: Record) => { const response = await ofetch(url, { method: "PUT", headers, body: JSON.stringify(body), }); return response; }, patch: async (url: string, body: JSON, headers: Record) => { const response = await ofetch(url, { method: "PATCH", headers, body: JSON.stringify(body), }); return response; }, delete: async (url: string, headers: Record) => { const response = await ofetch(url, { method: "DELETE", headers, }); return response; }, }; export default httpFetchClient;