fix(API): Fix workflow project transfer (#10651)
Co-authored-by: Benjamin Roedell <2271599+benrobot@users.noreply.github.com>
This commit is contained in:
@@ -84,11 +84,7 @@ export declare namespace WorkflowRequest {
|
||||
type Activate = Get;
|
||||
type GetTags = Get;
|
||||
type UpdateTags = AuthenticatedRequest<{ id: string }, {}, TagEntity[]>;
|
||||
type Transfer = AuthenticatedRequest<
|
||||
{ workflowId: string },
|
||||
{},
|
||||
{ destinationProjectId: string }
|
||||
>;
|
||||
type Transfer = AuthenticatedRequest<{ id: string }, {}, { destinationProjectId: string }>;
|
||||
}
|
||||
|
||||
export declare namespace UserRequest {
|
||||
|
||||
@@ -73,11 +73,13 @@ export = {
|
||||
transferWorkflow: [
|
||||
projectScope('workflow:move', 'workflow'),
|
||||
async (req: WorkflowRequest.Transfer, res: express.Response) => {
|
||||
const { id: workflowId } = req.params;
|
||||
|
||||
const body = z.object({ destinationProjectId: z.string() }).parse(req.body);
|
||||
|
||||
await Container.get(EnterpriseWorkflowService).transferOne(
|
||||
req.user,
|
||||
req.params.workflowId,
|
||||
workflowId,
|
||||
body.destinationProjectId,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user