Skip to content
Snippets Groups Projects
Verified Commit 04ce8064 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: correctly refer to the showId when passed as query parameter

parent cd709e14
No related branches found
No related tags found
No related merge requests found
......@@ -480,7 +480,7 @@ func (api *API) UploadFileFlowJS(c *gin.Context) {
// @Failure 500 {object} ErrorResponse
// @Router /api/v1/files/{id}/upload [get]
func (api *API) TestFileFlowJS(c *gin.Context) {
showID, err := idFromString(c.Query("show-id"))
showID, err := idFromString(c.Query("showId")) // showId is passed as a query parameter
if err != nil {
c.JSON(http.StatusBadRequest, ErrorResponse{Error: "invalid showId: " + err.Error()})
}
......
......@@ -227,7 +227,7 @@ func (api *API) ReadPlaylist(c *gin.Context) {
return
}
showID, _ := idFromString(c.Query("show-id")) // we ignore error because the showId is an optional query parameter
showID, _ := idFromString(c.Query("showId")) // we ignore error because the showId is an optional query parameter
if showID != 0 {
playlist, err := api.store.GetPlaylist(showID, id)
......
......@@ -209,8 +209,8 @@ func authorizeRequestForPlaylist(c *gin.Context, playlistID uint64, api *API) (b
}
func authorizeRequest(c *gin.Context, api *API) (bool, *auth.Session) {
// show-id is passed as query parameter
if showID, _ := idFromString(c.Query("show-id")); showID != 0 {
// showId is passed as query parameter
if showID, _ := idFromString(c.Query("showId")); showID != 0 {
return authorizeRequestForShow(c, showID)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment