more admin dashboard polish, some code cleanup
This commit is contained in:
parent
65f277b3f2
commit
a66460be19
23 changed files with 163 additions and 231 deletions
|
|
@ -157,7 +157,8 @@ func serveAddCredit(app *model.AppState, release *model.Release) http.Handler {
|
|||
|
||||
func serveNewCredit(app *model.AppState) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
artistID := strings.Split(r.URL.Path, "/")[3]
|
||||
split := strings.Split(r.URL.Path, "/")
|
||||
artistID := split[len(split) - 1]
|
||||
artist, err := controller.GetArtist(app.DB, artistID)
|
||||
if err != nil {
|
||||
fmt.Printf("WARN: Failed to fetch artist %s: %s\n", artistID, err)
|
||||
|
|
@ -231,7 +232,8 @@ func serveAddTrack(app *model.AppState, release *model.Release) http.Handler {
|
|||
|
||||
func serveNewTrack(app *model.AppState) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
trackID := strings.Split(r.URL.Path, "/")[3]
|
||||
split := strings.Split(r.URL.Path, "/")
|
||||
trackID := split[len(split) - 1]
|
||||
track, err := controller.GetTrack(app.DB, trackID)
|
||||
if err != nil {
|
||||
fmt.Printf("WARN: Failed to fetch track %s: %s\n", trackID, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue