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

@@ -258,7 +258,7 @@ func SetupRoutes(router *mux.Router) {
for _, route := range routes {
route := route
router.HandleFunc(route.Route, func(rw http.ResponseWriter, r *http.Request) {
conf, err := userCfgRepo.GetUIConfig(r)
conf, err := userCfgRepo.GetUIConfig(auth.GetUser(r.Context()))
if err != nil {
http.Error(rw, err.Error(), http.StatusInternalServerError)
return