WIP
This commit is contained in:
parent
3d0c9a5719
commit
7f0338c9a7
@ -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) => {
|
||||
|
@ -55,6 +55,7 @@ const leg_template: leg = {
|
||||
}
|
||||
const journey_template: journey = {
|
||||
fmt_ver: 1,
|
||||
version:0,
|
||||
title: "New Journey",
|
||||
main: [leg_template],
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user