diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-25 22:19:18 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-28 09:07:31 -0600 |
| commit | 59cf768ec72f1ad2cefb8085dee8667f40a13fcc (patch) | |
| tree | 402af1a0b9639ce7b5b250132f93a0c36febd9af /app | |
| parent | 5eb909197ac4832813112e77192c20704b9a1908 (diff) | |
refactor: remove unused template and action
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/sparkles/controller.go | 13 | ||||
| -rw-r--r-- | app/views/sparkles/new.html.tmpl | 5 |
2 files changed, 0 insertions, 18 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) diff --git a/app/views/sparkles/new.html.tmpl b/app/views/sparkles/new.html.tmpl deleted file mode 100644 index 077cb54..0000000 --- a/app/views/sparkles/new.html.tmpl +++ /dev/null @@ -1,5 +0,0 @@ -<form v-on:submit.prevent="submitSparkle"> - <label>/sparkle <input type="text" placeholder="@tanuki for helping me with my homework!" v-model="sparkle" /> </label> - <button type="submit" v-bind:disabled="isDisabled">✨ Sparkle</button> -</form> -<span class="error">${ errorMessage }</span> |
