1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Introduce entity aliases (unfinished).

This commit is contained in:
Ferdinand Mütsch
2019-07-06 17:53:20 +02:00
parent e23e7520d0
commit 37ec6c62fc
6 changed files with 77 additions and 5 deletions

View File

@ -2,6 +2,7 @@ package routes
import (
"crypto/md5"
"log"
"net/http"
"strconv"
"time"
@ -43,6 +44,13 @@ func (h *SummaryHandler) Get(w http.ResponseWriter, r *http.Request) {
}
user := r.Context().Value(models.UserKey).(*models.User)
// Initialize aliases for user
if !h.SummarySrvc.AliasService.IsInitialized(user.ID) {
log.Printf("Initializing aliases for user '%s'\n", user.ID)
h.SummarySrvc.AliasService.InitUser(user.ID)
}
params := r.URL.Query()
from, err := utils.ParseDate(params.Get("from"))
if err != nil {