Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
feat: add create pipeline router
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinsandilya committed Apr 17, 2024
1 parent 1786497 commit 0dec004
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/engine-backend/router/pipelineRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')}))
Expand Down Expand Up @@ -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 ||
Expand Down

0 comments on commit 0dec004

Please sign in to comment.