maj via codex

This commit is contained in:
2026-02-22 18:34:50 +01:00
parent 20af00d653
commit 55387f4b0e
90 changed files with 9902 additions and 1251 deletions

View File

@@ -14,9 +14,16 @@ export const usePlantingsStore = defineStore('plantings', () => {
plantings.value.push(created);
return created;
}
async function update(id, p) {
const updated = await plantingsApi.update(id, p);
const idx = plantings.value.findIndex(x => x.id === id);
if (idx !== -1)
plantings.value[idx] = updated;
return updated;
}
async function remove(id) {
await plantingsApi.delete(id);
plantings.value = plantings.value.filter(p => p.id !== id);
}
return { plantings, loading, fetchAll, create, remove };
return { plantings, loading, fetchAll, create, update, remove };
});