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

Default interval.

This commit is contained in:
Ferdinand Mütsch 2020-02-20 15:54:20 +01:00
parent 89b52778ef
commit f69b55b1f9

View File

@ -78,6 +78,12 @@ func (h *SummaryHandler) Index(w http.ResponseWriter, r *http.Request) {
h.loadTemplates() h.loadTemplates()
} }
q := r.URL.Query()
if q.Get("interval") == "" && q.Get("from") == "" {
q.Set("interval", "today")
r.URL.RawQuery = q.Encode()
}
summary, err, status := loadUserSummary(r, h.SummarySrvc) summary, err, status := loadUserSummary(r, h.SummarySrvc)
if err != nil { if err != nil {
w.WriteHeader(status) w.WriteHeader(status)