WIP
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
soraefir 2025-05-15 00:19:55 +02:00
parent 3d0c9a5719
commit 7f0338c9a7
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
3 changed files with 3 additions and 2 deletions

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;
}