Skip to content

Commit

Permalink
refactor: reroute to users page only if user is successfully deleted …
Browse files Browse the repository at this point in the history
…from individual user page
  • Loading branch information
JoelJacobStephen committed Apr 23, 2024
1 parent c1f2b78 commit d0485c8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/hoppscotch-sh-admin/src/pages/users/_id.vue
Expand Up @@ -208,13 +208,14 @@ const deleteUserMutation = async (id: string | null) => {
if (result.error) {
toast.error(t('state.delete_user_failure'));
} else {
const deletedUsers = result.data?.removeUsersByAdmin || [];
const deletedUser = result.data?.removeUsersByAdmin || [];
handleUserDeletion(deletedUser);
handleUserDeletion(deletedUsers);
const { isDeleted } = deletedUser[0];
if (isDeleted) router.push('/users');
}
confirmDeletion.value = false;
deleteUserUID.value = null;
!result.error && router.push('/users');
};
</script>

0 comments on commit d0485c8

Please sign in to comment.