Chore fix

This commit is contained in:
JeyGR 2024-12-19 11:15:07 +05:30 committed by jey-exp
parent ab86a3b871
commit 6e3d6cee39

View file

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