From 0dec004738a54da21a71bc8ec56b9240909752b9 Mon Sep 17 00:00:00 2001 From: jatin Date: Wed, 17 Apr 2024 16:32:40 +0530 Subject: [PATCH] feat: add create pipeline router --- .../engine-backend/router/pipelineRouter.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/engine-backend/router/pipelineRouter.ts b/packages/engine-backend/router/pipelineRouter.ts index 0195b2cdd..eb26564cd 100644 --- a/packages/engine-backend/router/pipelineRouter.ts +++ b/packages/engine-backend/router/pipelineRouter.ts @@ -36,6 +36,21 @@ export const pipelineRouter = trpc.router({ .mutation(async ({ctx, input: {id, ...input}}) => ctx.services.patchReturning('pipeline', id, input), ), + createPipeline: protectedProcedure + .meta({openapi: {method: 'POST', path: '/core/pipeline', tags}}) + .input( + zRaw.pipeline.pick({ + id: true, + metadata: true, + disabled: true, + sourceId: true, + destinationId: true, + }), + ) + .output(zRaw.pipeline) + .mutation(async ({ctx, input: {id, ...input}}) => + ctx.services.patchReturning('pipeline', id, input), + ), deletePipeline: protectedProcedure .meta({openapi: {method: 'DELETE', path: '/core/pipeline/{id}', tags}}) .input(z.object({id: zId('pipe')})) @@ -84,7 +99,7 @@ export const pipelineRouter = trpc.router({ ...standardReso, id: reso.id, displayName: - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + reso.displayName || standardReso?.displayName || standardInt?.name ||