Use custom identifiers
This commit is contained in:
parent
b2d50972ed
commit
299f3ba0cf
5 changed files with 45 additions and 16 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
|
|
@ -33,9 +32,9 @@ func declareGongsRoutes(cfg *config.Config, router *gin.RouterGroup) {
|
|||
return
|
||||
}
|
||||
|
||||
for _, t := range gongs {
|
||||
if base64.StdEncoding.EncodeToString(t.Id) == c.Param("tid") {
|
||||
c.Set("gong", t)
|
||||
for _, g := range gongs {
|
||||
if g.Id.ToString() == c.Param("tid") {
|
||||
c.Set("gong", g)
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
|
|
@ -34,7 +33,7 @@ func declareTracksRoutes(cfg *config.Config, router *gin.RouterGroup) {
|
|||
}
|
||||
|
||||
for _, t := range tracks {
|
||||
if base64.StdEncoding.EncodeToString(t.Id) == c.Param("tid") {
|
||||
if t.Id.ToString() == c.Param("tid") {
|
||||
c.Set("track", t)
|
||||
c.Next()
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue