WIP
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
soraefir
2025-05-15 00:55:06 +02:00
parent 6690b055b4
commit 38d895a959

View File

@ -41,14 +41,17 @@ export const load = (id: string) =>
return res;
});
var version_add = 1
export const save = async (id: string, v: journey) => {
v.version +=1;
return fetch("/api/" + id, { method: "post", body: JSON.stringify(v) })
let body = JSON.parse(JSON.stringify(v))
body.version +=version_add;
return fetch("/api/" + id, { method: "post", body: JSON.stringify(body) })
.then((res) => {
if (!res.ok) throw new Error("Error " + res.statusText);
return res.json();
})
.then((_res) => {
version_add+=1;
console.log("Saved...");
});
}