Error box, download button, editor save and more.

Former-commit-id: c14972384cc8afad28d49388b0b4545669e20b7d [formerly 0af2e5f9aff2aac576044ca9590045f656fbffda] [formerly 02248a86b7063e1c9d6779c3574a848708ff86f2 [formerly efaa8439a9]]
Former-commit-id: 4ce0a81ea04b56cef11d62107d692502e266a16e [formerly 2c46db9398c267351c10f06c089ed08dc3625232]
Former-commit-id: 1c93a0643217ab69668600b41e2d8263266d7e23
This commit is contained in:
Henrique Dias
2017-07-06 14:40:06 +01:00
parent 7def1b2325
commit 0012601652
14 changed files with 180 additions and 102 deletions

4
api.go
View File

@@ -59,8 +59,6 @@ func serveAPI(c *requestContext, w http.ResponseWriter, r *http.Request) (int, e
}
}
fmt.Println(c.us)
switch router {
case "download":
return downloadHandler(c, w, r)
@@ -524,14 +522,12 @@ func usersPutHandler(c *requestContext, w http.ResponseWriter, r *http.Request)
pw, err := hashPassword(u.Password)
if err != nil {
fmt.Println(err)
return http.StatusInternalServerError, err
}
c.us.Password = pw
err = c.fm.db.UpdateField(&User{ID: c.us.ID}, "Password", pw)
if err != nil {
fmt.Println(err)
return http.StatusInternalServerError, err
}