feat(merge_component): ✨ sync new recipe version
add re-read and sync new file after saving, the new file should be appeared on the file list
This commit is contained in:
parent
09c21301d6
commit
860dc05cde
2 changed files with 12 additions and 0 deletions
|
|
@ -407,7 +407,16 @@ export class MergeComponent implements OnInit, AfterViewInit, OnDestroy, OnChang
|
||||||
to_send
|
to_send
|
||||||
).subscribe({
|
).subscribe({
|
||||||
next: (value) => {
|
next: (value) => {
|
||||||
|
// do alert user with the new filename
|
||||||
|
|
||||||
|
// this is ok case
|
||||||
|
if((value.result as string).includes(".json")){
|
||||||
|
alert("Upgrade success! New recipe file is " + value.result);
|
||||||
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
// this is error case
|
||||||
|
alert(value.result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -916,6 +916,9 @@ func (rr *RecipeRouter) upgradeVersion(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// refresh recipe files so the running server can see the new file without restart itself
|
||||||
|
rr.data.AllRecipeFiles = helpers.ScanRecipeFiles(rr.data.Countries)
|
||||||
|
|
||||||
w.Header().Add("Content-Type", "application/json")
|
w.Header().Add("Content-Type", "application/json")
|
||||||
json.NewEncoder(w).Encode(map[string]interface{}{
|
json.NewEncoder(w).Encode(map[string]interface{}{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue