summaryrefslogtreecommitdiff
path: root/app/controllers/sparkles
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-04-25 22:19:18 -0600
committermo khan <mo@mokhan.ca>2025-04-28 09:07:31 -0600
commit59cf768ec72f1ad2cefb8085dee8667f40a13fcc (patch)
tree402af1a0b9639ce7b5b250132f93a0c36febd9af /app/controllers/sparkles
parent5eb909197ac4832813112e77192c20704b9a1908 (diff)
refactor: remove unused template and action
Diffstat (limited to 'app/controllers/sparkles')
-rw-r--r--app/controllers/sparkles/controller.go13
1 files changed, 0 insertions, 13 deletions
diff --git a/app/controllers/sparkles/controller.go b/app/controllers/sparkles/controller.go
index 35f2076..4ae028b 100644
--- a/app/controllers/sparkles/controller.go
+++ b/app/controllers/sparkles/controller.go
@@ -7,10 +7,8 @@ import (
"github.com/xlgmokha/x/pkg/mapper"
"github.com/xlgmokha/x/pkg/serde"
"github.com/xlgmokha/x/pkg/x"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/middleware"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/views"
)
type Controller struct {
@@ -25,7 +23,6 @@ func (c *Controller) MountTo(mux *http.ServeMux) {
requireUser := middleware.RequireUser()
mux.HandleFunc("GET /sparkles", c.Index)
- mux.Handle("GET /sparkles/new", requireUser(http.HandlerFunc(c.NewForm)))
mux.Handle("POST /sparkles", requireUser(http.HandlerFunc(c.Create)))
}
@@ -36,16 +33,6 @@ func (c *Controller) Index(w http.ResponseWriter, r *http.Request) {
}
}
-func (c *Controller) NewForm(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(http.StatusOK)
- w.Header().Add("Content-Type", "text/html")
-
- dto := &NewSparkleDTO{CurrentUser: cfg.CurrentUser.From(r.Context())}
- if err := views.Render(w, "sparkles/new", dto); err != nil {
- log.WithFields(r.Context(), log.Fields{"error": err})
- }
-}
-
func (c *Controller) Create(w http.ResponseWriter, r *http.Request) {
sparkle := mapper.MapFrom[*http.Request, *domain.Sparkle](r)