Skip to content

Commit d63aa80

Browse files
committed
Fix for Slack integration paths
1 parent afbaf6b commit d63aa80

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
22
import { prisma } from "~/db.server";
3+
import { env } from "~/env.server";
34
import { redirectWithSuccessMessage } from "~/models/message.server";
45
import { OrgIntegrationRepository } from "~/models/orgIntegration.server";
56
import { findProjectBySlug } from "~/models/project.server";
67
import { requireUserId } from "~/services/session.server";
78
import {
9+
EnvironmentParamSchema,
810
ProjectParamSchema,
911
v3NewProjectAlertPath,
1012
v3NewProjectAlertPathConnectToSlackPath,
1113
} from "~/utils/pathBuilder";
1214

1315
export async function loader({ request, params }: LoaderFunctionArgs) {
1416
const userId = await requireUserId(request);
15-
const { organizationSlug, projectParam } = ProjectParamSchema.parse(params);
17+
const { organizationSlug, projectParam, envParam } = EnvironmentParamSchema.parse(params);
1618

1719
const project = await findProjectBySlug(organizationSlug, projectParam, userId);
1820

@@ -30,7 +32,9 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
3032

3133
if (integration) {
3234
return redirectWithSuccessMessage(
33-
`${v3NewProjectAlertPath({ slug: organizationSlug }, project)}?option=slack`,
35+
`${v3NewProjectAlertPath({ slug: organizationSlug }, project, {
36+
slug: envParam,
37+
})}?option=slack`,
3438
request,
3539
"Successfully connected your Slack workspace"
3640
);
@@ -40,7 +44,9 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
4044
"SLACK",
4145
project.organizationId,
4246
request,
43-
v3NewProjectAlertPathConnectToSlackPath({ slug: organizationSlug }, project)
47+
v3NewProjectAlertPathConnectToSlackPath({ slug: organizationSlug }, project, {
48+
slug: envParam,
49+
})
4450
);
4551
}
4652
}

0 commit comments

Comments
 (0)