Skip to content

Commit

Permalink
Fix radio request handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bb4L committed Jul 9, 2021
1 parent b34c47e commit b3491f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apiserver/radio/radio.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ type changeValue struct {

func postRadio(w http.ResponseWriter, r *http.Request) {
radio, err := storageHelper.GetRadio(false)
defer storageHelper.SaveRadio(radio)

if err != nil {
w.WriteHeader(http.StatusInternalServerError)
Expand Down Expand Up @@ -84,6 +83,8 @@ func postRadio(w http.ResponseWriter, r *http.Request) {
radio.StopRadio()
}

storageHelper.SaveRadio(radio)

jsonData, err := json.Marshal(radio)
if err != nil {
logger.Printf("json error %s", err)
Expand Down

0 comments on commit b3491f9

Please sign in to comment.