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

revert last three commits

parent feab2d41
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@
package v1
import (
"github.com/gin-gonic/gin/binding"
"net/http"
"strconv"
......@@ -26,10 +25,6 @@ import (
"gitlab.servus.at/autoradio/tank/store"
)
type ShowId struct {
ShowId uint64 `json:"showId"`
}
func idFromString(s string) (uint64, error) {
return strconv.ParseUint(s, 10, 64)
}
......@@ -41,16 +36,7 @@ func getShowID(c *gin.Context) (uint64, error) {
showID = c.Query("showId")
}
if showID != "" {
return idFromString(showID)
}
// read the showId as JSON from the body and allow the body to be read again
var showId ShowId
if err := c.ShouldBindBodyWith(&showId, binding.JSON); err != nil {
return 0, err
}
return showId.ShowId, nil
return idFromString(showID)
}
func statusCodeFromError(err error) (code int, response ErrorResponse) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment