From f3abcc365b46e2776a6f0da330a10493eb58a07b Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 22 Apr 2025 17:24:04 -0600 Subject: refactor: convert id token to user in mapper --- app/controllers/dashboard/controller.go | 6 ++---- app/controllers/dashboard/dto.go | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/controllers/dashboard/controller.go b/app/controllers/dashboard/controller.go index 106666b..02238bb 100644 --- a/app/controllers/dashboard/controller.go +++ b/app/controllers/dashboard/controller.go @@ -31,10 +31,8 @@ func (c *Controller) Show(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) w.Header().Add("Content-Type", "text/html") - if err := views.Render(w, "dashboard/show", &ViewDashboardDTO{ - CurrentUser: currentUser, - Sparkles: []string{}, - }); err != nil { + dto := &ViewDashboardDTO{CurrentUser: currentUser} + if err := views.Render(w, "dashboard/show", dto); err != nil { log.WithFields(r.Context(), log.Fields{"error": err}) w.WriteHeader(http.StatusInternalServerError) return diff --git a/app/controllers/dashboard/dto.go b/app/controllers/dashboard/dto.go index 4243adc..ff587ae 100644 --- a/app/controllers/dashboard/dto.go +++ b/app/controllers/dashboard/dto.go @@ -4,6 +4,4 @@ import "gitlab.com/gitlab-org/software-supply-chain-security/authorization/spark type ViewDashboardDTO struct { CurrentUser *domain.User - Sparkles []string - Title string } -- cgit v1.2.3