mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
fix: create profile
This commit is contained in:
1 parent
cec5d78881
commit
e83ddb92ae
1 file changed
+8
-5
@@ -4,6 +4,8 @@ import { API_URL } from 'lib/constants'
|
||||
import { useCallback } from 'react'
|
||||
import { profileKeys } from './keys'
|
||||
import Telemetry from 'lib/telemetry'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useTelemetryProps } from 'common'
|
||||
|
||||
export type Profile = {
|
||||
id: number
|
||||
@@ -25,18 +27,19 @@ export type ProfileResponse = Profile
|
||||
* This will also need to send a sign_up event
|
||||
*/
|
||||
async function createProfile() {
|
||||
const router = useRouter()
|
||||
const telemetryProps = useTelemetryProps()
|
||||
|
||||
const response = await post(`${API_URL}/profile`, {})
|
||||
if (response.error) {
|
||||
throw response.error
|
||||
}
|
||||
|
||||
// send conversion event
|
||||
Telemetry.sendEvent(
|
||||
{ category: 'conversion', action: 'sign_up', label: '' },
|
||||
{
|
||||
screenResolution:
|
||||
typeof window !== 'undefined' ? `${window.innerWidth}x${window.innerHeight}` : undefined,
|
||||
language: 'en-US',
|
||||
}
|
||||
telemetryProps,
|
||||
router
|
||||
)
|
||||
|
||||
return response
|
||||
|
||||
Reference in new issue
Block a user