From 2bbcd3d9e6f2e1531a27df9b21509c7323f81667 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Fri, 17 Mar 2023 00:00:15 -0700 Subject: [PATCH] parse invite url from mutationFn --- frontend/src/hooks/api/users/queries.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/hooks/api/users/queries.tsx b/frontend/src/hooks/api/users/queries.tsx index c6b35960d..5d0759755 100644 --- a/frontend/src/hooks/api/users/queries.tsx +++ b/frontend/src/hooks/api/users/queries.tsx @@ -83,8 +83,14 @@ export const useAddUserToWs = () => { export const useAddUserToOrg = () => { const queryClient = useQueryClient(); + type Response = { + data: { + message: string, + completeInviteLink: string | undefined + } + } - return useMutation<{}, {}, AddUserToOrgDTO>({ + return useMutation({ mutationFn: (dto) => apiRequest.post(`/api/v1/invite-org/signup`, dto), onSuccess: (_, { organizationId }) => { queryClient.invalidateQueries(userKeys.getOrgUsers(organizationId));