From 045221a3ad89fd55a2fee9c961f307be713117d6 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 3 Aug 2024 13:40:01 +0300 Subject: [PATCH] Remove useless body requirement for CardDeleteId --- handlers/card.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/handlers/card.go b/handlers/card.go index ccd80d8..aa6e1bf 100644 --- a/handlers/card.go +++ b/handlers/card.go @@ -208,7 +208,6 @@ func CardPutId(c *gin.Context) { // @Produce json // @Param Authorization header string true "Bearer token" // @Param cardID path int true "id" -// @Param card body types.DbCard true "Card" // @Success 200 {object} types.DbCard // @Failure 400 {object} types.ErrorResponse // @Failure 401 {object} types.ErrorResponse @@ -253,12 +252,6 @@ func CardDeleteId(c *gin.Context) { c.JSON(401, types.ErrorResponse{Message: "This card.id is not yours, you sneaky."}) return } - var card types.DbCard - if err := c.ShouldBindJSON(&card); err != nil { - c.JSON(400, types.ErrorResponse{Message: "Invalid request"}) - return - } - if err := dbc.Delete(dbCard).Error; err != nil { c.JSON(500, types.ErrorResponse{Message: err.Error()}) return