avant codex

This commit is contained in:
2026-02-22 15:05:40 +01:00
parent fed449c784
commit 20af00d653
291 changed files with 51868 additions and 424 deletions

View File

@@ -0,0 +1,26 @@
import { defineStore } from 'pinia';
import { ref } from 'vue';
import { toolsApi } from '@/api/tools';
export const useToolsStore = defineStore('tools', () => {
const tools = ref([]);
const loading = ref(false);
async function fetchAll() {
loading.value = true;
try {
tools.value = await toolsApi.list();
}
finally {
loading.value = false;
}
}
async function create(t) {
const created = await toolsApi.create(t);
tools.value.push(created);
return created;
}
async function remove(id) {
await toolsApi.delete(id);
tools.value = tools.value.filter(t => t.id !== id);
}
return { tools, loading, fetchAll, create, remove };
});