Skip to content

Commit 994014c

Browse files
committed
Apply some fixes suggested by mr rabbit
1 parent 9171eff commit 994014c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings/route.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import {
1515
useNavigation,
1616
useNavigate,
1717
} from "@remix-run/react";
18-
import { type LoaderFunctionArgs } from "@remix-run/router";
19-
import { type ActionFunction, json } from "@remix-run/server-runtime";
18+
import { type ActionFunction, type LoaderFunctionArgs, json } from "@remix-run/server-runtime";
2019
import { typedjson, useTypedLoaderData } from "remix-typedjson";
2120
import { z } from "zod";
2221
import { AdminDebugTooltip } from "~/components/admin/debugTooltip";
@@ -78,7 +77,7 @@ import { env } from "~/env.server";
7877
import { useEnvironment } from "~/hooks/useEnvironment";
7978
import { DateTime } from "~/components/primitives/DateTime";
8079
import { checkGitHubBranchExists } from "~/services/gitHub.server";
81-
import { tryCatch } from "@trigger.dev/core";
80+
import { tryCatch } from "@trigger.dev/core/utils";
8281
import { TextLink } from "~/components/primitives/TextLink";
8382
import { cn } from "~/utils/cn";
8483

@@ -412,12 +411,13 @@ export const action: ActionFunction = async ({ request, params }) => {
412411
return redirectBackWithSuccessMessage(request, "Git settings updated successfully");
413412
}
414413
case "connect-repo": {
415-
const { repositoryId } = submission.value;
414+
const { repositoryId, installationId } = submission.value;
416415

417416
const [repository, existingConnection] = await Promise.all([
418417
prisma.githubRepository.findFirst({
419418
where: {
420419
id: repositoryId,
420+
installationId,
421421
installation: {
422422
organizationId: project.organizationId,
423423
},

apps/webapp/app/services/gitHub.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { App, type Octokit } from "octokit";
22
import { env } from "../env.server";
33
import { prisma } from "~/db.server";
44
import { logger } from "./logger.server";
5-
import { tryCatch } from "@trigger.dev/core";
5+
import { tryCatch } from "@trigger.dev/core/utils";
66

77
export const githubApp =
88
env.GITHUB_APP_ENABLED === "1"

apps/webapp/app/v3/github.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ export function getTrackedBranchForEnvironment(
1919
branchName?: string;
2020
}
2121
): string | undefined {
22-
if (!branchTracking) return undefined;
2322
switch (environment.type) {
2423
case "PRODUCTION":
25-
return branchTracking.prod?.branch;
24+
return branchTracking?.prod?.branch;
2625
case "STAGING":
27-
return branchTracking.staging?.branch;
26+
return branchTracking?.staging?.branch;
2827
case "PREVIEW":
2928
return previewDeploymentsEnabled ? environment.branchName : undefined;
3029
case "DEVELOPMENT":
3130
return undefined;
3231
default:
33-
return environment.type satisfies never;
32+
environment.type satisfies never;
33+
return undefined;
3434
}
3535
}

0 commit comments

Comments
 (0)