Skip to content

Commit 13489c6

Browse files
committed
fix(webapp): Fix typings
1 parent cccb4e2 commit 13489c6

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

apps/webapp/app/models/orgIntegration.server.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ export type AuthenticatableIntegration = OrganizationIntegration & {
4747
tokenReference: SecretReference;
4848
};
4949

50+
export function isIntegrationForService<TService extends IntegrationService>(
51+
integration: AuthenticatableIntegration,
52+
service: TService
53+
): integration is OrganizationIntegrationForService<TService> {
54+
return (integration.service satisfies IntegrationService) === service;
55+
}
56+
5057
export class OrgIntegrationRepository {
5158
static async getAuthenticatedClientForIntegration<TService extends IntegrationService>(
5259
integration: OrganizationIntegrationForService<TService>,

apps/webapp/app/routes/api.v1.deployments.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
4848
deployment.externalBuildData as InitializeDeploymentResponseBody["externalBuildData"],
4949
imageTag: imageRef,
5050
imagePlatform: deployment.imagePlatform,
51-
environmentSlug: authenticatedEnv.slug,
5251
eventStream,
5352
};
5453

apps/webapp/app/v3/services/alerts/deliverAlert.server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { environmentTitle } from "~/components/environments/EnvironmentLabel";
2222
import { type Prisma, type prisma, type PrismaClientOrTransaction } from "~/db.server";
2323
import { env } from "~/env.server";
2424
import {
25+
isIntegrationForService,
2526
type OrganizationIntegrationForService,
2627
OrgIntegrationRepository,
2728
} from "~/models/orgIntegration.server";
@@ -644,7 +645,7 @@ export class DeliverAlertService extends BaseService {
644645
},
645646
});
646647

647-
if (!integration) {
648+
if (!integration || !isIntegrationForService(integration, "SLACK")) {
648649
logger.error("[DeliverAlert] Slack integration not found", {
649650
alert,
650651
});

0 commit comments

Comments
 (0)