feat(webui): add accounts username and isAdmin flag edition for admins
Closes #43
This commit is contained in:
parent
4f68621bad
commit
373f567773
6 changed files with 111 additions and 50 deletions
|
@ -81,11 +81,17 @@ func handleAccountsIdResetPasswordPOST(db *database.DB) http.Handler {
|
|||
return
|
||||
}
|
||||
account.SetPassword(password)
|
||||
if err := db.SaveAccount(account); err != nil {
|
||||
success, err := db.SaveAccount(account)
|
||||
if err != nil {
|
||||
errorResponse(w, r, http.StatusInternalServerError,
|
||||
fmt.Errorf("failed to save account: %w", err))
|
||||
return
|
||||
}
|
||||
if !success {
|
||||
errorResponse(w, r, http.StatusInternalServerError,
|
||||
fmt.Errorf("failed to save account: table constraint error"))
|
||||
return
|
||||
}
|
||||
render(w, accountsIdResetPasswordTemplates, http.StatusOK,
|
||||
AccountsIdResetPasswordPage{
|
||||
Account: account,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue