@@ -18,7 +18,11 @@ import { findProjectBySlug } from "~/models/project.server";
1818import { findEnvironmentBySlug } from "~/models/runtimeEnvironment.server" ;
1919import { requireUserId } from "~/services/session.server" ;
2020import { env } from "~/env.server" ;
21- import { EnvironmentParamSchema , v3ErrorsConnectToSlackPath } from "~/utils/pathBuilder" ;
21+ import {
22+ EnvironmentParamSchema ,
23+ v3ErrorsConnectToSlackPath ,
24+ v3ErrorsPath ,
25+ } from "~/utils/pathBuilder" ;
2226import {
2327 type CreateAlertChannelOptions ,
2428 CreateAlertChannelService ,
@@ -46,12 +50,15 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
4650 slug : envParam ,
4751 } ) ;
4852
53+ const errorsPath = v3ErrorsPath ( { slug : organizationSlug } , project , { slug : envParam } ) ;
54+
4955 return typedjson ( {
5056 alertData,
5157 projectRef : project . externalRef ,
5258 projectId : project . id ,
5359 environmentType : environment . type ,
5460 connectToSlackHref,
61+ errorsPath,
5562 } ) ;
5663} ;
5764
@@ -162,7 +169,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
162169} ;
163170
164171export default function Page ( ) {
165- const { alertData, connectToSlackHref } = useTypedLoaderData < typeof loader > ( ) ;
172+ const { alertData, connectToSlackHref, errorsPath } = useTypedLoaderData < typeof loader > ( ) ;
166173 const { has } = useSearchParams ( ) ;
167174 const showAlerts = has ( "alerts" ) ?? false ;
168175
@@ -176,7 +183,11 @@ export default function Page() {
176183 < >
177184 < ResizableHandle id = "errors-alerts-handle" />
178185 < ResizablePanel id = "errors-alerts" min = "320px" default = "420px" max = "560px" >
179- < ConfigureErrorAlerts { ...alertData } connectToSlackHref = { connectToSlackHref } />
186+ < ConfigureErrorAlerts
187+ { ...alertData }
188+ connectToSlackHref = { connectToSlackHref }
189+ formAction = { errorsPath }
190+ />
180191 </ ResizablePanel >
181192 </ >
182193 ) }
0 commit comments