Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: members leave api

phamhieud2cf6c4c5036
diff --git a/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx b/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
index 04cb1a953a2..a0f8d64a3ad 100644
--- a/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
+++ b/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
@@ -6,7 +6,7 @@ import * as Tooltip from '@radix-ui/react-tooltip'
import { useStore } from 'hooks'
import useProfile from 'hooks/misc/useProfile'
import { useParams } from 'common/hooks'
-import { post } from 'lib/common/fetch'
+import { delete_ } from 'lib/common/fetch'
import { API_URL } from 'lib/constants'
import InviteMemberButton from './InviteMemberButton'
import MembersView from './MembersView'
@@ -43,7 +43,9 @@ const TeamSettings = () => {
title: 'Are you sure?',
message: 'Are you sure you want to leave this team? This is permanent.',
onAsyncConfirm: async () => {
- const response = await post(`${API_URL}/organizations/${slug}/members/leave`, {})
+ const response = await delete_(
+ `${API_URL}/organizations/${slug}/members/${profile!.gotrue_id}`
+ )
if (response.error) {
throw response.error
} else {