summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/sparkles/controller.go13
-rw-r--r--app/views/sparkles/new.html.tmpl5
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>