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

@ -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})
}
}