@@ -3,7 +3,7 @@ import type {
33 LoaderFunctionArgs ,
44} from "@remix-run/node" ;
55import { json , redirect } from "@remix-run/node" ;
6- import { Form , useActionData , useLoaderData , useNavigation } from "@remix-run/react" ;
6+ import { Form , useActionData , useNavigation } from "@remix-run/react" ;
77import { typedjson , useTypedLoaderData } from "remix-typedjson" ;
88import { z } from "zod" ;
99import { DialogClose } from "@radix-ui/react-dialog" ;
@@ -20,7 +20,7 @@ import { FormButtons } from "~/components/primitives/FormButtons";
2020import { Header1 } from "~/components/primitives/Headers" ;
2121import { PageBody , PageContainer } from "~/components/layout/AppLayout" ;
2222import { Paragraph } from "~/components/primitives/Paragraph" ;
23- import { Table , TableBlankRow , TableBody , TableCell , TableHeader , TableHeaderCell , TableRow } from "~/components/primitives/Table" ;
23+ import { Table , TableBody , TableCell , TableHeader , TableHeaderCell , TableRow } from "~/components/primitives/Table" ;
2424import { VercelIntegrationRepository } from "~/models/vercelIntegration.server" ;
2525import { $transaction , prisma } from "~/db.server" ;
2626import { requireOrganization } from "~/services/org.server" ;
@@ -123,6 +123,11 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
123123 const { organizationSlug } = OrganizationParamsSchema . parse ( params ) ;
124124 const { organization, userId } = await requireOrganization ( request , organizationSlug ) ;
125125
126+ const formData = await request . formData ( ) ;
127+ const result = ActionSchema . safeParse ( { intent : formData . get ( "intent" ) } ) ;
128+ if ( ! result . success ) {
129+ return json ( { error : "Invalid action" } , { status : 400 } ) ;
130+ }
126131
127132 // Find Vercel integration
128133 const vercelIntegration = await prisma . organizationIntegration . findFirst ( {
@@ -347,11 +352,6 @@ export default function VercelIntegrationPage() {
347352 </ TableCell >
348353 </ TableRow >
349354 ) ) }
350- { connectedProjects . length === 0 && (
351- < TableBlankRow colSpan = { 4 } >
352- < Paragraph > No connected projects found.</ Paragraph >
353- </ TableBlankRow >
354- ) }
355355 </ TableBody >
356356 </ Table >
357357 ) }
0 commit comments