|
|
@ -35,10 +35,14 @@ export class DuplicateController { |
|
|
|
@Param('projectId') projectId: string, |
|
|
|
@Param('projectId') projectId: string, |
|
|
|
@Param('baseId') baseId?: string, |
|
|
|
@Param('baseId') baseId?: string, |
|
|
|
@Body() |
|
|
|
@Body() |
|
|
|
options?: { |
|
|
|
body?: { |
|
|
|
excludeData?: boolean; |
|
|
|
options?: { |
|
|
|
excludeViews?: boolean; |
|
|
|
excludeData?: boolean; |
|
|
|
excludeHooks?: boolean; |
|
|
|
excludeViews?: boolean; |
|
|
|
|
|
|
|
excludeHooks?: boolean; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
// override duplicated project
|
|
|
|
|
|
|
|
project?: any; |
|
|
|
}, |
|
|
|
}, |
|
|
|
) { |
|
|
|
) { |
|
|
|
const project = await Project.get(projectId); |
|
|
|
const project = await Project.get(projectId); |
|
|
@ -63,7 +67,11 @@ export class DuplicateController { |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const dupProject = await this.projectsService.projectCreate({ |
|
|
|
const dupProject = await this.projectsService.projectCreate({ |
|
|
|
project: { title: uniqueTitle, status: ProjectStatus.JOB }, |
|
|
|
project: { |
|
|
|
|
|
|
|
title: uniqueTitle, |
|
|
|
|
|
|
|
status: ProjectStatus.JOB, |
|
|
|
|
|
|
|
...(body.project || {}), |
|
|
|
|
|
|
|
}, |
|
|
|
user: { id: req.user.id }, |
|
|
|
user: { id: req.user.id }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -71,7 +79,7 @@ export class DuplicateController { |
|
|
|
projectId: project.id, |
|
|
|
projectId: project.id, |
|
|
|
baseId: base.id, |
|
|
|
baseId: base.id, |
|
|
|
dupProjectId: dupProject.id, |
|
|
|
dupProjectId: dupProject.id, |
|
|
|
options, |
|
|
|
options: body.options || {}, |
|
|
|
req: { |
|
|
|
req: { |
|
|
|
user: req.user, |
|
|
|
user: req.user, |
|
|
|
clientIp: req.clientIp, |
|
|
|
clientIp: req.clientIp, |
|
|
@ -89,10 +97,12 @@ export class DuplicateController { |
|
|
|
@Param('projectId') projectId: string, |
|
|
|
@Param('projectId') projectId: string, |
|
|
|
@Param('modelId') modelId?: string, |
|
|
|
@Param('modelId') modelId?: string, |
|
|
|
@Body() |
|
|
|
@Body() |
|
|
|
options?: { |
|
|
|
body?: { |
|
|
|
excludeData?: boolean; |
|
|
|
options?: { |
|
|
|
excludeViews?: boolean; |
|
|
|
excludeData?: boolean; |
|
|
|
excludeHooks?: boolean; |
|
|
|
excludeViews?: boolean; |
|
|
|
|
|
|
|
excludeHooks?: boolean; |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
) { |
|
|
|
) { |
|
|
|
const project = await Project.get(projectId); |
|
|
|
const project = await Project.get(projectId); |
|
|
@ -121,7 +131,7 @@ export class DuplicateController { |
|
|
|
baseId: base.id, |
|
|
|
baseId: base.id, |
|
|
|
modelId: model.id, |
|
|
|
modelId: model.id, |
|
|
|
title: uniqueTitle, |
|
|
|
title: uniqueTitle, |
|
|
|
options, |
|
|
|
options: body.options || {}, |
|
|
|
req: { |
|
|
|
req: { |
|
|
|
user: req.user, |
|
|
|
user: req.user, |
|
|
|
clientIp: req.clientIp, |
|
|
|
clientIp: req.clientIp, |
|
|
|