Skip to content

Commit fbb5e41

Browse files
committed
remove unused hook
1 parent 10c7db5 commit fbb5e41

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

apps/sim/hooks/queries/invitations.ts

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -66,47 +66,6 @@ export function usePendingInvitations(workspaceId: string | undefined) {
6666
})
6767
}
6868

69-
interface SendInvitationParams {
70-
workspaceId: string
71-
email: string
72-
permission: 'admin' | 'write' | 'read'
73-
}
74-
75-
/**
76-
* Sends a single workspace invitation.
77-
* Invalidates the invitation list cache on success.
78-
*/
79-
export function useSendWorkspaceInvitation() {
80-
const queryClient = useQueryClient()
81-
82-
return useMutation({
83-
mutationFn: async ({ workspaceId, email, permission }: SendInvitationParams) => {
84-
const response = await fetch('/api/workspaces/invitations', {
85-
method: 'POST',
86-
headers: { 'Content-Type': 'application/json' },
87-
body: JSON.stringify({
88-
workspaceId,
89-
email,
90-
role: 'member',
91-
permission,
92-
}),
93-
})
94-
95-
if (!response.ok) {
96-
const error = await response.json()
97-
throw new Error(error.error || 'Failed to send invitation')
98-
}
99-
100-
return response.json()
101-
},
102-
onSuccess: (_data, variables) => {
103-
queryClient.invalidateQueries({
104-
queryKey: invitationKeys.list(variables.workspaceId),
105-
})
106-
},
107-
})
108-
}
109-
11069
interface BatchSendInvitationsParams {
11170
workspaceId: string
11271
invitations: Array<{ email: string; permission: 'admin' | 'write' | 'read' }>

0 commit comments

Comments
 (0)