diff --git a/apiserver/radio/radio.go b/apiserver/radio/radio.go index 87f24b7..82a94a0 100644 --- a/apiserver/radio/radio.go +++ b/apiserver/radio/radio.go @@ -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) @@ -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)