mirror of
https://github.com/supabase/supabase.git
synced 2026-06-21 21:12:49 +08:00
19 lines
444 B
TypeScript
19 lines
444 B
TypeScript
interface DataProps {
|
|
[prop: string]: any
|
|
}
|
|
|
|
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)
|
|
})
|
|
}
|