fix: return updated project instead of the old one

This commit is contained in:
kolaente 2023-04-12 11:38:51 +02:00
parent bbaddb9406
commit 4ab547810c
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 2 deletions

View File

@ -111,12 +111,12 @@ export const useProjectStore = defineStore('project', () => {
const projectService = new ProjectService()
try {
await projectService.update(project)
const updatedProject = await projectService.update(project)
setProject(project)
// the returned project from projectService.update is the same!
// in order to not create a manipulation in pinia store we have to create a new copy
return klona(project)
return updatedProject
} catch (e) {
// Reset the project state to the initial one to avoid confusion for the user
setProject({