Remove useless body requirement for CardDeleteId

This commit is contained in:
qowevisa 2024-08-03 13:40:01 +03:00
parent ab22cdf2ef
commit 045221a3ad

View File

@ -208,7 +208,6 @@ func CardPutId(c *gin.Context) {
// @Produce json // @Produce json
// @Param Authorization header string true "Bearer token" // @Param Authorization header string true "Bearer token"
// @Param cardID path int true "id" // @Param cardID path int true "id"
// @Param card body types.DbCard true "Card"
// @Success 200 {object} types.DbCard // @Success 200 {object} types.DbCard
// @Failure 400 {object} types.ErrorResponse // @Failure 400 {object} types.ErrorResponse
// @Failure 401 {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."}) c.JSON(401, types.ErrorResponse{Message: "This card.id is not yours, you sneaky."})
return 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 { if err := dbc.Delete(dbCard).Error; err != nil {
c.JSON(500, types.ErrorResponse{Message: err.Error()}) c.JSON(500, types.ErrorResponse{Message: err.Error()})
return return