mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-13 13:35:23 +01:00
Add more comments
This commit is contained in:
parent
783e2c044d
commit
f434fcbc72
1 changed files with 2 additions and 0 deletions
|
@ -33,11 +33,13 @@ func (rt *_router) UpdateUsername(w http.ResponseWriter, r *http.Request, ps htt
|
|||
|
||||
status, err := rt.db.UpdateUsername(uid, req.Name)
|
||||
|
||||
// check if the username already exists
|
||||
if status == database.ERR_EXISTS {
|
||||
helpers.SendStatus(http.StatusConflict, w, "Username already exists", rt.baseLogger)
|
||||
return
|
||||
}
|
||||
|
||||
// handle any other database error
|
||||
if err != nil {
|
||||
helpers.SendInternalError(err, "Database error: UpdateUsername", w, rt.baseLogger)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue