Files
supabase/apps/docs/lib/fetchWrappers.tsx
2022-11-07 19:41:26 +08:00

21 lines
475 B
TypeScript

interface DataProps {
referrer?: string
title: string
route?: string
}
export const post = (url: string, data: DataProps, options = {}) => {
return fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
},
referrerPolicy: 'no-referrer-when-downgrade',
body: JSON.stringify(data),
...options,
}).catch((error) => {
console.error('Error at fetchWrapper - post:', error)
})
}