feat: add stickers delete api

This commit is contained in:
Krispire Admin
2026-08-30 10:31:37 +05:30
parent 4427849647
commit a2d22ed829
5 changed files with 111 additions and 0 deletions
+13
View File
@@ -141,6 +141,19 @@ func (h *SadhnaHandler) GiftableRewards(w http.ResponseWriter, r *http.Request)
response.JSON(w, http.StatusOK, list)
}
// DeleteCustomGift — DELETE /admin/reward-gifts/{key}
func (h *SadhnaHandler) DeleteCustomGift(w http.ResponseWriter, r *http.Request) {
if err := h.svc.DeleteCustomGift(r.Context(), chi.URLParam(r, "key")); err != nil {
if errors.Is(err, repository.ErrRewardNotFound) {
response.Error(w, http.StatusNotFound, "no such custom gift")
return
}
response.Error(w, http.StatusBadRequest, err.Error())
return
}
response.NoContent(w)
}
type customGiftReq struct {
Name string `json:"name"`
Meaning string `json:"meaning"`