mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
Add documentation for aliases.
Reload aliases for every summary request.
This commit is contained in:
@ -2,7 +2,6 @@ package routes
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"log"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
@ -14,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
IntervalToday string = "today"
|
||||
IntervalToday string = "today"
|
||||
IntervalLastDay string = "day"
|
||||
IntervalLastWeek string = "week"
|
||||
IntervalLastMonth string = "month"
|
||||
@ -45,15 +44,8 @@ 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()
|
||||
interval := params.Get("interval")
|
||||
interval := params.Get("interval")
|
||||
from, err := utils.ParseDate(params.Get("from"))
|
||||
if err != nil {
|
||||
switch interval {
|
||||
|
Reference in New Issue
Block a user