changed the delete to handle parameter differently
This commit is contained in:
parent
d819b04020
commit
009e79332a
@ -121,9 +121,9 @@ func NewRouter(svc service.EpisodeService) *gin.Engine {
|
|||||||
c.JSON(http.StatusOK, items)
|
c.JSON(http.StatusOK, items)
|
||||||
})
|
})
|
||||||
|
|
||||||
// DELETE /v1/shows/:id — delete a row from "current" by id
|
// DELETE /v1/shows — delete a row from "current" by id
|
||||||
v1.DELETE("/shows/:id", func(c *gin.Context) {
|
v1.DELETE("/shows", func(c *gin.Context) {
|
||||||
idStr := c.Param("id")
|
idStr := c.Query("id")
|
||||||
id, err := strconv.ParseInt(idStr, 10, 64)
|
id, err := strconv.ParseInt(idStr, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid id"})
|
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid id"})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user