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
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue