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

@ -20,13 +20,15 @@ function OrgUsersAdd() {
const [selectedInviteCode, setSelectedInviteCode] = React.useState('');
async function sendInvites() {
const toastId = toast.loading("Sending invite...")
setIsLoading(true)
let res = await inviteBatchUsers(org.id, invitedUsers, selectedInviteCode,access_token)
if (res.status == 200) {
mutate(`${getAPIUrl()}orgs/${org?.id}/invites/users`)
setIsLoading(false)
toast.success("Invite sent", {id:toastId})
} else {
toast.error('Error ' + res.status + ': ' + res.data.detail)
toast.error('Error sending invite', {id:toastId})
setIsLoading(false)
}