mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
Added toast notifications
This commit is contained in:
parent
feebdfcfe9
commit
ab86a3b871
8 changed files with 48 additions and 18 deletions
|
|
@ -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});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue