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
|
|
@ -29,12 +29,14 @@ function OrgUserGroups() {
|
|||
)
|
||||
|
||||
const deleteUserGroupUI = async (usergroup_id: any) => {
|
||||
const toastId = toast.loading("Deleting...");
|
||||
const res = await deleteUserGroup(usergroup_id, access_token)
|
||||
if (res.status == 200) {
|
||||
mutate(`${getAPIUrl()}usergroups/org/${org.id}`)
|
||||
toast.success("Deleted usergroup", {id:toastId})
|
||||
}
|
||||
else {
|
||||
toast.error('Error ' + res.status + ': ' + res.data.detail)
|
||||
toast.error('Error deleting usergroup', {id:toastId})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue