Skip to content

Commit

Permalink
fix: members leave api
Browse files Browse the repository at this point in the history
  • Loading branch information
phamhieu authored and loong committed Jun 15, 2023
1 parent 16b49c9 commit 1913422
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as Tooltip from '@radix-ui/react-tooltip'

import { useStore } from 'hooks'
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'
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1913422

Please sign in to comment.