@@ -23,11 +23,13 @@ import { NavBar, PageTitle } from "~/components/primitives/PageHeader";
2323import { Paragraph } from "~/components/primitives/Paragraph" ;
2424import { Select , SelectItem } from "~/components/primitives/Select" ;
2525import { prisma } from "~/db.server" ;
26+ import { env } from "~/env.server" ;
2627import { featuresForRequest } from "~/features.server" ;
2728import {
2829 redirectWithErrorMessage ,
2930 redirectWithSuccessMessage ,
3031} from "~/models/message.server" ;
32+ import type { CreatePrivateLinkConnectionBody } from "@trigger.dev/platform" ;
3133import {
3234 createPrivateLink ,
3335 getPrivateLinkRegions ,
@@ -69,7 +71,7 @@ export async function loader({ params, request }: LoaderFunctionArgs) {
6971
7072 const [ error , regions ] = await tryCatch ( getPrivateLinkRegions ( organization . id ) ) ;
7173
72- const awsAccountIds = process . env . PRIVATE_CONNECTIONS_AWS_ACCOUNT_IDS ?. split ( "," ) . filter ( Boolean ) ?? [ ] ;
74+ const awsAccountIds = env . PRIVATE_CONNECTIONS_AWS_ACCOUNT_IDS ?. split ( "," ) . filter ( Boolean ) ?? [ ] ;
7375
7476 return typedjson ( {
7577 availableRegions : regions ?. availableRegions ?? [ "us-east-1" , "eu-central-1" ] ,
@@ -128,7 +130,10 @@ export const action: ActionFunction = async ({ request, params }) => {
128130 }
129131
130132 const [ error ] = await tryCatch (
131- createPrivateLink ( organization . id , { ...rest , targetRegion : selectedRegion } )
133+ createPrivateLink ( organization . id , {
134+ ...rest ,
135+ targetRegion : selectedRegion as CreatePrivateLinkConnectionBody [ "targetRegion" ] ,
136+ } )
132137 ) ;
133138
134139 if ( error ) {
0 commit comments