From 575bda4518d70f5555446cc65fd022e354d8424d Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Mon, 18 Dec 2023 23:23:30 -0100 Subject: [PATCH] feat: Allow more params for resource create and update --- packages/engine-backend/router/resourceRouter.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/engine-backend/router/resourceRouter.ts b/packages/engine-backend/router/resourceRouter.ts index c8622bde..ea96913d 100644 --- a/packages/engine-backend/router/resourceRouter.ts +++ b/packages/engine-backend/router/resourceRouter.ts @@ -73,7 +73,17 @@ export const resourceRouter = trpc.router({ }), createResource: protectedProcedure .meta({openapi: {method: 'POST', path: '/core/resource', tags}}) - .input(zRaw.resource.pick({connectorConfigId: true, settings: true})) + .input( + zRaw.resource.pick({ + connectorConfigId: true, + settings: true, + displayName: true, + endUserId: true, + disabled: true, + metadata: true, + integrationId: true, + }), + ) // Questionable why `zConnectContextInput` should be there. Examine whether this is actually // needed // How do we verify that the userId here is the same as the userId from preConnectOption? @@ -123,6 +133,10 @@ export const resourceRouter = trpc.router({ settings: true, displayName: true, metadata: true, + disabled: true, + // Not sure if we should allow these two? + endUserId: true, + integrationId: true, }), ) .output(zRaw.resource)