File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/settings/components/teammates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use client'
22
33import { useCallback , useMemo , useState } from 'react'
4+ import { getErrorMessage } from '@sim/utils/errors'
45import { useQueryClient } from '@tanstack/react-query'
56import { useParams , useRouter } from 'next/navigation'
67import {
@@ -15,6 +16,7 @@ import {
1516 MoreHorizontal ,
1617 Plus ,
1718 Search ,
19+ toast ,
1820} from '@/components/emcn'
1921import type { WorkspacePermission } from '@/lib/api/contracts/workspaces'
2022import {
@@ -284,7 +286,19 @@ export function Teammates() {
284286 className = 'text-[var(--text-error)]'
285287 onSelect = { ( ) => {
286288 if ( teammate . userId ) {
287- removeMember . mutate ( { userId : teammate . userId , workspaceId } )
289+ removeMember . mutate (
290+ { userId : teammate . userId , workspaceId } ,
291+ {
292+ onError : ( error ) => {
293+ toast . error ( "Couldn't remove teammate" , {
294+ description : getErrorMessage (
295+ error ,
296+ 'Please try again in a moment.'
297+ ) ,
298+ } )
299+ } ,
300+ }
301+ )
288302 }
289303 } }
290304 >
You can’t perform that action at this time.
0 commit comments