Skip to content

Commit

Permalink
fix: DELETE method does not allow a body
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTipo01 committed Oct 25, 2023
1 parent f8f5d07 commit cfa7692
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (a *Api) addToQueue(c *gin.Context) {
}

func (a *Api) skip(c *gin.Context) {
token := c.PostForm("token")
token := c.Query("token")
guild := c.Param("guild")
u, authorized := a.checkAuthorizationAndGuild(token, guild)
if !authorized {
Expand Down Expand Up @@ -180,14 +180,14 @@ func (a *Api) getFavorites(c *gin.Context) {
}

func (a *Api) removeFavorite(c *gin.Context) {
token := c.PostForm("token")
token := c.Query("token")
u, authorized := a.checkAuthorization(token)
if !authorized {
c.AbortWithStatus(http.StatusUnauthorized)
return
}

name := c.PostForm("name")
name := c.Query("name")
err := a.clients.Database.RemoveFavorite(u.ID, name)
if err != nil {
c.AbortWithStatus(http.StatusInternalServerError)
Expand Down

0 comments on commit cfa7692

Please sign in to comment.