mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
add pending email cancel button
This commit is contained in:
committed by
Constantin Graf
parent
734aab6353
commit
24c19e7e7c
@@ -93,3 +93,21 @@ export function useResendUserEmailVerificationMutation() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function useResetUserPendingEmailMutation() {
|
||||
const queryClient = useQueryClient();
|
||||
const { handleApiRequestNotifications } = useNotificationsStore();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async (userId: string) => {
|
||||
return handleApiRequestNotifications(
|
||||
() => api.resetUserPendingEmail(undefined, { params: { user: userId } }),
|
||||
'Email change canceled',
|
||||
'Failed to cancel email change'
|
||||
);
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ME_QUERY_KEY });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user