[FEAT] Save name fix
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user