Skip to content

Commit

Permalink
add user not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
mgtennant committed Jul 11, 2024
1 parent 7282f8c commit f7fc21b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/components/modal/admin/AddRoles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ const AddRoles = ({
setError('User already exists.')
setShowError(true)
} else {
setUserObject(data)
if (data && data.username) {
setUserObject(data)
} else {
setError('User not found.')
setShowError(true)
}
}
} catch (error) {
setError('An error occurred during removal.')
Expand Down

0 comments on commit f7fc21b

Please sign in to comment.