Clean and lint

This commit is contained in:
Nathan Barber
2021-12-01 01:52:18 -05:00
parent c0d5778d93
commit 999cc0a37c
6 changed files with 32 additions and 35 deletions

View File

@@ -71,7 +71,7 @@ const AddUser = (props) => {
type="checkbox"
id="admin-check"
checked={admin}
onChange={(e) => setAdmin(!admin)}
onChange={() => setAdmin(!admin)}
/>
<span> </span>
<label className="form-check-label">Admin</label>
@@ -104,14 +104,16 @@ const AddUser = (props) => {
? updateUsers(0, limit)
.then((data) => dispatchPageChange(data, 0))
.then(() => history.push("/"))
.catch((err) => console.log(err))
.catch(() =>
setErrorAlert(`Failed to update users.`)
)
: setErrorAlert(
`Failed to create user. ${
data.status == 409 ? "User already exists." : ""
}`
)
)
.catch((err) => setErrorAlert(`Failed to create user.`));
.catch(() => setErrorAlert(`Failed to create user.`));
}}
>
Add Users