forked from vikunja/frontend
fix(projects): update project duplicate api definitions
This commit is contained in:
parent
82c9a91d39
commit
b742c55287
@ -3,6 +3,6 @@ import type {IProject} from './IProject'
|
||||
|
||||
export interface IProjectDuplicate extends IAbstract {
|
||||
projectId: number
|
||||
project: IProject
|
||||
duplicatedProject: IProject | null
|
||||
parentProjectId: IProject['id']
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user