From d29239cbb56aa9e4c279ecf209ca1c13263b22a2 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Sat, 11 Apr 2026 22:29:06 +0200 Subject: [PATCH] add demo check Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- back/internal/api/handler/search.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/back/internal/api/handler/search.go b/back/internal/api/handler/search.go index dfd2285..d9c1083 100644 --- a/back/internal/api/handler/search.go +++ b/back/internal/api/handler/search.go @@ -137,6 +137,10 @@ func (h *SearchHandler) Get(w http.ResponseWriter, r *http.Request) { // DELETE /searches/{id} func (h *SearchHandler) Delete(w http.ResponseWriter, r *http.Request) { + if h.demo { + respond.Error(w, http.StatusForbidden, "demo mode: deletions are disabled") + return + } id := chi.URLParam(r, "id") if err := h.manager.Delete(id); err != nil { respond.Error(w, http.StatusNotFound, err.Error())