fix(dashboard): #163 month selection on first load
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 4m54s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 4m56s

This commit was merged in pull request #183.
This commit is contained in:
2025-06-16 12:52:49 +02:00
parent 6b8059889d
commit 3df9fab25b
6 changed files with 8 additions and 8 deletions

View File

@@ -22,12 +22,14 @@ type Index interface {
type IndexImpl struct {
r *Render
d *service.Dashboard
c service.Clock
}
func NewIndex(r *Render, d *service.Dashboard) Index {
func NewIndex(r *Render, d *service.Dashboard, c service.Clock) Index {
return IndexImpl{
r: r,
d: d,
c: c,
}
}
@@ -81,7 +83,7 @@ func (handler IndexImpl) dashboard(user *types.User, htmx bool, r *http.Request)
return nil, fmt.Errorf("could not parse timestamp: %w", service.ErrBadRequest)
}
} else {
month = time.Now()
month = handler.c.Now()
}
summary, err := handler.d.Summary(r.Context(), user, month)