feat(frontend): layout header + drawer + router (9 routes)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 04:12:35 +01:00
parent f29f90a16f
commit 3c5f0d571f
36 changed files with 836 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
import { defineStore } from 'pinia';
import { ref } from 'vue';
import { tasksApi } from '@/api/tasks';
export const useTasksStore = defineStore('tasks', () => {
const tasks = ref([]);
const loading = ref(false);
async function fetchAll(params) {
loading.value = true;
tasks.value = await tasksApi.list(params);
loading.value = false;
}
async function create(t) {
const created = await tasksApi.create(t);
tasks.value.push(created);
return created;
}
async function updateStatut(id, statut) {
const t = tasks.value.find(t => t.id === id);
if (!t)
return;
const updated = await tasksApi.update(id, { ...t, statut });
Object.assign(t, updated);
}
async function remove(id) {
await tasksApi.delete(id);
tasks.value = tasks.value.filter(t => t.id !== id);
}
return { tasks, loading, fetchAll, create, updateStatut, remove };
});