Added toast notifications

This commit is contained in:
JeyGR 2024-12-18 22:17:01 +05:30 committed by jey-exp
parent feebdfcfe9
commit ab86a3b871
8 changed files with 48 additions and 18 deletions

View file

@ -31,11 +31,13 @@ function OrgUsers() {
}
const handleRemoveUser = async (user_id: any) => {
const toastId = toast.loading("Removing...");
const res = await removeUserFromOrg(org.id, user_id,access_token)
if (res.status === 200) {
await mutate(`${getAPIUrl()}orgs/${org.id}/users`)
toast.success("Removed user from org", {id:toastId});
} else {
toast.error('Error ' + res.status + ': ' + res.data.detail)
toast.error('Error removing user', {id:toastId});
}
}