mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
Chore fix
This commit is contained in:
parent
ab86a3b871
commit
6e3d6cee39
1 changed files with 3 additions and 3 deletions
|
|
@ -41,15 +41,15 @@ function RolesUpdate(props: Props) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
setIsSubmitting(true)
|
setIsSubmitting(true)
|
||||||
const res = await updateUserRole(org.id, props.user.user.id, assignedRole,access_token)
|
const res = await updateUserRole(org.id, props.user.user.id, assignedRole,access_token)
|
||||||
|
const toastId = toast.loading("Updating role...")
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
await mutate(`${getAPIUrl()}orgs/${org.id}/users`)
|
await mutate(`${getAPIUrl()}orgs/${org.id}/users`)
|
||||||
props.setRolesModal(false)
|
props.setRolesModal(false)
|
||||||
toast.success("Updated role")
|
toast.success("Updated role", {id:toastId})
|
||||||
} else {
|
} else {
|
||||||
setIsSubmitting(false)
|
setIsSubmitting(false)
|
||||||
setError('Error ' + res.status + ': ' + res.data.detail)
|
setError('Error ' + res.status + ': ' + res.data.detail)
|
||||||
toast.error("Couldn't update now")
|
toast.error("Couldn't update now", {id:toastId})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue