diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-31 16:09:12 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-31 16:09:12 -0600 |
| commit | 238b61113456ebad8bad880913dc315cd892a296 (patch) | |
| tree | f38db8e10c4b55aef21c96c30fc71278c6e3d5c6 /app/controllers/sparkles | |
| parent | ebb003ef2beaeee61104d6b88a342c5c9fa73b51 (diff) | |
| parent | 311603d0c0b04d451e9fb8e5e8335dca8425e2c4 (diff) | |
Merge branch 'sparkle-visibility' into 'main'
Connect to postgresql
See merge request gitlab-org/software-supply-chain-security/authorization/sparkled!21
Diffstat (limited to 'app/controllers/sparkles')
| -rw-r--r-- | app/controllers/sparkles/controller.go | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/app/controllers/sparkles/controller.go b/app/controllers/sparkles/controller.go index 90767b2..86610e1 100644 --- a/app/controllers/sparkles/controller.go +++ b/app/controllers/sparkles/controller.go @@ -3,7 +3,6 @@ package sparkles import ( "net/http" - "github.com/xlgmokha/x/pkg/log" "github.com/xlgmokha/x/pkg/mapper" "github.com/xlgmokha/x/pkg/serde" "github.com/xlgmokha/x/pkg/x" @@ -32,9 +31,6 @@ func (c *Controller) MountTo(mux *http.ServeMux) { middleware.RequireUser(), // middleware.RequirePermission("create", c.check), )) - - // This is a temporary endpoint to restore a backup - mux.HandleFunc("POST /sparkles/restore", c.Restore) } func (c *Controller) Index(w http.ResponseWriter, r *http.Request) { @@ -64,16 +60,3 @@ func (c *Controller) Create(w http.ResponseWriter, r *http.Request) { return } } - -// This is a temporary endpoint to restore a backup -// of sparkles and can be deleted once we have an actual database -func (c *Controller) Restore(w http.ResponseWriter, r *http.Request) { - sparkles, _ := serde.FromHTTP[[]*domain.Sparkle](r) - log.WithFields(r.Context(), log.Fields{"sparkles": sparkles}) - - x.Each(sparkles, func(sparkle *domain.Sparkle) { - if err := c.db.Save(r.Context(), sparkle); err != nil { - pls.LogError(r.Context(), err) - } - }) -} |
