Skip to content

Commit

Permalink
fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk committed Sep 14, 2024
1 parent ccf65e8 commit b5837fd
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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}`,
Expand Down

0 comments on commit b5837fd

Please sign in to comment.