Refactor sponsor slides to not require reloading the audience display to pick up changes.

This commit is contained in:
Patrick Fairbank
2018-09-14 00:22:44 -07:00
parent 833bd32ab2
commit 2f3b402c34
6 changed files with 51 additions and 62 deletions

View File

@@ -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)