fix: redirect to the users list view on successful deletion from the profile view
SH Admin dashboard
This commit is contained in:
@@ -40,17 +40,11 @@ export const handleUserDeletion = (deletedUsersList: UserDeletionResult[]) => {
|
|||||||
|
|
||||||
// Show the success toast based on the action type if there are no errors
|
// Show the success toast based on the action type if there are no errors
|
||||||
if (uniqueErrorMessages.size === 0) {
|
if (uniqueErrorMessages.size === 0) {
|
||||||
if (isBulkAction) {
|
toast.success(
|
||||||
toast.success(
|
isBulkAction
|
||||||
isBulkAction
|
? t('state.delete_users_success')
|
||||||
? t('state.delete_user_success')
|
: t('state.delete_user_success')
|
||||||
: t('state.delete_users_success')
|
);
|
||||||
);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
toast.success(t('state.delete_user_success'));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,6 @@ const deleteUserMutation = async (id: string | null) => {
|
|||||||
|
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
toast.error(t('state.delete_user_failure'));
|
toast.error(t('state.delete_user_failure'));
|
||||||
router.push('/users');
|
|
||||||
} else {
|
} else {
|
||||||
const deletedUsers = result.data?.removeUsersByAdmin || [];
|
const deletedUsers = result.data?.removeUsersByAdmin || [];
|
||||||
|
|
||||||
@@ -215,5 +214,7 @@ const deleteUserMutation = async (id: string | null) => {
|
|||||||
}
|
}
|
||||||
confirmDeletion.value = false;
|
confirmDeletion.value = false;
|
||||||
deleteUserUID.value = null;
|
deleteUserUID.value = null;
|
||||||
|
|
||||||
|
!result.error && router.push('/users');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user