mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 02:15:05 +03:00
* docs: user nav dropdown * www: user dropdown nav * update menus * chore: add complete local storage allowlist * move all local-storage to common * reload after logOut * add local storage key changes from #35175 * fix errors * add more keys * fix merge bugs --------- Co-authored-by: Alaister Young <a@alaisteryoung.com>
17 lines
573 B
TypeScript
17 lines
573 B
TypeScript
import { components } from 'api-types'
|
|
import { handleError, post } from 'data/fetchers'
|
|
import { IS_PLATFORM } from './constants'
|
|
import { LOCAL_STORAGE_KEYS, hasConsented } from 'common'
|
|
|
|
type TrackFeatureFlagVariables = components['schemas']['TelemetryFeatureFlagBodyDto']
|
|
|
|
export async function trackFeatureFlag(body: TrackFeatureFlagVariables) {
|
|
const consent = hasConsented()
|
|
|
|
if (!consent || !IS_PLATFORM) return undefined
|
|
const { data, error } = await post(`/platform/telemetry/feature-flags/track`, { body })
|
|
|
|
if (error) handleError(error)
|
|
return data
|
|
}
|