fix: more refactoring #181

This commit is contained in:
2024-10-20 15:02:39 +02:00
parent 38d530a3c9
commit 77bf66a4fc
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))