mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 15:19:08 +03:00
* Store referrer in session storage until opted-in * Fix * Move to common file * Refactor the useTelemetryCookie hook. Use the hook in www, docs and studio. * Small fixes. * Fix all usages of HandlePageTelemetry function. * Fix type errors. --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
25 lines
611 B
TypeScript
25 lines
611 B
TypeScript
interface DataProps {
|
|
[prop: string]: any
|
|
}
|
|
|
|
export const post = (url: string, data: DataProps, options = {} as { [key: string]: any }) => {
|
|
const { headers: optionHeaders, ...otherOptions } = options
|
|
|
|
let headers = new Headers({
|
|
'Content-Type': 'application/json',
|
|
Accept: 'application/json',
|
|
...optionHeaders,
|
|
})
|
|
|
|
return fetch(url, {
|
|
method: 'POST',
|
|
headers,
|
|
credentials: 'include',
|
|
referrerPolicy: 'no-referrer-when-downgrade',
|
|
body: JSON.stringify(data),
|
|
...otherOptions,
|
|
}).catch((error) => {
|
|
console.error('Error at fetchWrapper - post:', error)
|
|
})
|
|
}
|