fix: more refactoring #181
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 1m43s

This commit is contained in:
2024-10-20 15:02:39 +02:00
parent d3ff302d3e
commit cf96c9be5b
6 changed files with 153 additions and 56 deletions

View File

@@ -3,7 +3,6 @@ package handler
import (
"me-fit/service"
"me-fit/template"
"me-fit/template/auth"
"me-fit/types"
"me-fit/utils"
@@ -32,10 +31,10 @@ func NewHandlerIndex(db *sql.DB, service service.ServiceAuth, serverSettings *ty
}
func (handler HandlerIndexImpl) handle(router *http.ServeMux) {
router.Handle("/", handler handleIndexAnd404())
router.Handle("/", handler.handleIndexAnd404())
}
func (handler HanHandlerIndexImpl) handleIndexAnd404() http.HandlerFunc {
func (handler HandlerIndexImpl) handleIndexAnd404() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
user, err := handler.service.GetUserFromSessionId(utils.GetSessionID(r))