From 009e79332a07e2cb37a7e87b00556b1b48f6ec30 Mon Sep 17 00:00:00 2001 From: Nik Afiq Date: Sat, 22 Nov 2025 20:26:30 +0900 Subject: [PATCH] changed the delete to handle parameter differently --- backend/internal/http/handlers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/internal/http/handlers.go b/backend/internal/http/handlers.go index 081a77a..e0d6d64 100644 --- a/backend/internal/http/handlers.go +++ b/backend/internal/http/handlers.go @@ -121,9 +121,9 @@ func NewRouter(svc service.EpisodeService) *gin.Engine { c.JSON(http.StatusOK, items) }) - // DELETE /v1/shows/:id — delete a row from "current" by id - v1.DELETE("/shows/:id", func(c *gin.Context) { - idStr := c.Param("id") + // DELETE /v1/shows — delete a row from "current" by id + v1.DELETE("/shows", func(c *gin.Context) { + idStr := c.Query("id") id, err := strconv.ParseInt(idStr, 10, 64) if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": "invalid id"})