Refactor UserCfg, add test

This commit is contained in:
Jan Eitzinger
2022-09-12 13:34:21 +02:00
parent c0daad256f
commit 10c6b366a5
4 changed files with 71 additions and 11 deletions

View File

@@ -595,7 +595,7 @@ func (api *RestApi) updateConfiguration(rw http.ResponseWriter, r *http.Request)
fmt.Printf("KEY: %#v\nVALUE: %#v\n", key, value)
if err := repository.GetUserCfgRepo().UpdateConfig(key, value, r.Context()); err != nil {
if err := repository.GetUserCfgRepo().UpdateConfig(key, value, auth.GetUser(r.Context())); err != nil {
http.Error(rw, err.Error(), http.StatusUnprocessableEntity)
return
}