fix(projects): update project duplicate api definitions

This commit is contained in:
kolaente 2023-07-07 13:00:48 +02:00
parent 82c9a91d39
commit b742c55287
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 5 additions and 5 deletions

View File

@ -3,6 +3,6 @@ import type {IProject} from './IProject'
export interface IProjectDuplicate extends IAbstract {
projectId: number
project: IProject
duplicatedProject: IProject | null
parentProjectId: IProject['id']
}

View File

@ -6,13 +6,13 @@ import type {IProject} from '@/modelTypes/IProject'
export default class ProjectDuplicateModel extends AbstractModel<IProjectDuplicate> implements IProjectDuplicate {
projectId = 0
project: IProject = ProjectModel
duplicatedProject: IProject | null = null
parentProjectId = 0
constructor(data : Partial<IProjectDuplicate>) {
super()
this.assignData(data)
this.project = new ProjectModel(this.project)
this.duplicatedProject = this.duplicatedProject ? new ProjectModel(this.duplicatedProject) : null
}
}

View File

@ -250,9 +250,9 @@ export function useProject(projectId: MaybeRef<IProject['id']>) {
const duplicate = await projectDuplicateService.create(projectDuplicate)
projectStore.setProject(duplicate.project)
projectStore.setProject(duplicate.duplicatedProject)
success({message: t('project.duplicate.success')})
router.push({name: 'project.index', params: {projectId: duplicate.project.id}})
router.push({name: 'project.index', params: {projectId: duplicate.duplicatedProject.id}})
}
return {