very rough updates to admin pages, reduced reliance on global.DB
This commit is contained in:
parent
ae254dd731
commit
7044f7344b
15 changed files with 192 additions and 106 deletions
|
@ -126,7 +126,7 @@ func UpdateTrack(track *model.Track) http.Handler {
|
|||
|
||||
err = controller.UpdateTrack(global.DB, track)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to update track %s: %s\n", track.ID, err)
|
||||
fmt.Printf("WARN: Failed to update track %s: %s\n", track.ID, err)
|
||||
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ func DeleteTrack(track *model.Track) http.Handler {
|
|||
var trackID = r.URL.Path[1:]
|
||||
err := controller.DeleteTrack(global.DB, trackID)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to delete track %s: %s\n", trackID, err)
|
||||
fmt.Printf("WARN: Failed to delete track %s: %s\n", trackID, err)
|
||||
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue