From b5837fd8e8e633d0c031a5c3ab2228b50d7feb58 Mon Sep 17 00:00:00 2001 From: Zachary Blasczyk Date: Fri, 13 Sep 2024 21:37:36 -0500 Subject: [PATCH] fix deployment --- .../_components/CreateDeployment.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/CreateDeployment.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/CreateDeployment.tsx index a088c6a0..be89ca08 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/CreateDeployment.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/CreateDeployment.tsx @@ -39,7 +39,7 @@ import { Textarea } from "@ctrlplane/ui/textarea"; import { api } from "~/trpc/react"; -const deploymentForm = z.object(deploymentSchema.shape); +const deploymentForm = z.object(deploymentSchema.omit({ id: true }).shape); export const CreateDeploymentDialog: React.FC<{ children?: React.ReactNode; @@ -78,10 +78,17 @@ export const CreateDeploymentDialog: React.FC<{ const onSubmit = handleSubmit(async (deployment) => { const systemSlug = systems.data?.items.find( - (system) => system.id === deployment.systemId, + (system) => system.id === form.getValues("systemId"), )?.slug; await createDeployment - .mutateAsync({ ...deployment }) + .mutateAsync( + deployment as { + systemId: string; + name: string; + slug: string; + description: string; + }, + ) .then(() => { router.push( `/${workspaceSlug}/systems/${systemSlug}/deployments/${deployment.slug}`,