dev #199

Closed
sora wants to merge 21 commits from dev into master
25 changed files with 3485 additions and 2145 deletions
Showing only changes of commit 7f0338c9a7 - Show all commits

View File

@@ -41,7 +41,7 @@ export const load = (id: string) =>
return res;
});
export const save = (id: string, v: journey) =>{
export const save = async (id: string, v: journey) =>{
v.version = v.version +1
return fetch("/api/" + id, { method: "post", body: JSON.stringify(v) })
.then((res) => {

View File

@@ -55,6 +55,7 @@ const leg_template: leg = {
}
const journey_template: journey = {
fmt_ver: 1,
version:0,
title: "New Journey",
main: [leg_template],
}

View File

@@ -10,7 +10,7 @@ function migrate_A_to_0(e: journey): journey {
v.travel = v.travel || [];
v.day_title = typeof (v.day_title) == "string" ? [v.day_title] : [];
})
e.version = e.version | 0;
e.version = e.version || 0;
console.log(e)
return e;
}