mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Refactor sponsor slides to not require reloading the audience display to pick up changes.
This commit is contained in:
@@ -85,6 +85,10 @@ func (web *Web) sponsorSlidesApiHandler(w http.ResponseWriter, r *http.Request)
|
||||
return
|
||||
}
|
||||
|
||||
if sponsors == nil {
|
||||
// Go marshals an empty slice to null, so explicitly create it so that it appears as an empty JSON array.
|
||||
sponsors = make([]model.SponsorSlide, 0)
|
||||
}
|
||||
jsonData, err := json.MarshalIndent(sponsors, "", " ")
|
||||
if err != nil {
|
||||
handleWebErr(w, err)
|
||||
|
||||
Reference in New Issue
Block a user