[FEAT] Save name fix

This commit is contained in:
2026-01-01 19:20:16 +01:00
parent a314721a60
commit 934b6cba9b
6 changed files with 197 additions and 45 deletions

View File

@@ -62,14 +62,20 @@ export const useProjectStore = defineStore('project', () => {
}
}
async function updateProject(id: string, data: any) {
async function updateProject(id: string, name: string, data: any) {
if (!authStore.user) return;
isLoading.value = true;
try {
const record = await authStore.pb.collection('projects').update(id, {
name,
data,
});
currentProject.value = { ...currentProject.value!, data: record.data, updated: record.updated };
currentProject.value = {
...currentProject.value!,
name: record.name,
data: record.data,
updated: record.updated
};
await fetchProjects();
} catch (error) {
console.error('Failed to update project:', error);