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

feat: add create pipeline router #5

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
jatinsandilya marked this conversation as resolved.
Show resolved Hide resolved
),
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
Loading