mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-05 12:22:35 +02: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)
|
status, err := rt.db.UpdateUsername(uid, req.Name)
|
||||||
|
|
||||||
|
// check if the username already exists
|
||||||
if status == database.ERR_EXISTS {
|
if status == database.ERR_EXISTS {
|
||||||
helpers.SendStatus(http.StatusConflict, w, "Username already exists", rt.baseLogger)
|
helpers.SendStatus(http.StatusConflict, w, "Username already exists", rt.baseLogger)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handle any other database error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helpers.SendInternalError(err, "Database error: UpdateUsername", w, rt.baseLogger)
|
helpers.SendInternalError(err, "Database error: UpdateUsername", w, rt.baseLogger)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue