From 7132452d2902f6da2c4a87d1218c047789a914b2 Mon Sep 17 00:00:00 2001 From: Koen Verheyen Date: Wed, 25 Sep 2024 10:17:22 +0200 Subject: [PATCH] Refactored dashboard code #1676 --- handlers/dashboard.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/handlers/dashboard.go b/handlers/dashboard.go index 17e7bfeb..e75a537d 100644 --- a/handlers/dashboard.go +++ b/handlers/dashboard.go @@ -144,16 +144,16 @@ func ActionRequired(w http.ResponseWriter, r *http.Request) { func CandidateRecords(w http.ResponseWriter, r *http.Request) { c := ctx.Get(r) - searchArgs := models.NewSearchArgs(). - WithFilter("Status", "new"). - WithFilter("PersonID", c.User.ID) - searchArgs.PageSize = 4 - var total int var recs []*models.CandidateRecord var err error if c.FlagCandidateRecords() { + searchArgs := models.NewSearchArgs(). + WithPageSize(4). + WithFilter("Status", "new"). + WithFilter("PersonID", c.User.ID) + total, recs, err = c.Repo.GetCandidateRecords(r.Context(), searchArgs) }