The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
move integration IDs to constants
Steven Teybdfe717b85b6
diff --git a/apps/web/app/api/stripe/connect/webhook/account-application-deauthorized.ts b/apps/web/app/api/stripe/connect/webhook/account-application-deauthorized.tsindex 559fc3fd8d..92191dfacd 100644--- a/apps/web/app/api/stripe/connect/webhook/account-application-deauthorized.ts+++ b/apps/web/app/api/stripe/connect/webhook/account-application-deauthorized.ts@@ -1,4 +1,5 @@import { prisma } from "@/lib/prisma";+import { STRIPE_INTEGRATION_ID } from "@dub/utils";import type Stripe from "stripe";// Handle event "account.application.deauthorized"@@ -20,9 +21,7 @@ export async function accountApplicationDeauthorized(event: Stripe.Event) {await prisma.installedIntegration.deleteMany({where: {projectId: workspace.id,- integration: {- slug: "stripe",- },+ integrationId: STRIPE_INTEGRATION_ID,},});diff --git a/apps/web/lib/integrations/slack/slash-commands.ts b/apps/web/lib/integrations/slack/slash-commands.tsindex 9664528e8a..cbd1a76f44 100644--- a/apps/web/lib/integrations/slack/slash-commands.ts+++ b/apps/web/lib/integrations/slack/slash-commands.ts@@ -3,6 +3,7 @@ import { prisma } from "@/lib/prisma";import { WorkspaceProps } from "@/lib/types";import z from "@/lib/zod";import { createLinkBodySchema } from "@/lib/zod/schemas/links";+import { SLACK_INTEGRATION_ID } from "@dub/utils";import { InstalledIntegration } from "@prisma/client";import { verifySlackSignature } from "./verify-request";@@ -35,7 +36,7 @@ export const handleSlashCommand = async (const installation = await prisma.installedIntegration.findFirst({where: {- integrationId: "clzu59rx9000110bm5fnlzwuj",+ integrationId: SLACK_INTEGRATION_ID,credentials: {path: "$.team.id",equals: data.team_id,diff --git a/packages/stripe-app/stripe-app.json b/packages/stripe-app/stripe-app.jsonindex 35263677cd..c6d4979f74 100644--- a/packages/stripe-app/stripe-app.json+++ b/packages/stripe-app/stripe-app.json@@ -50,4 +50,4 @@],"stripe_api_access_type": "oauth","distribution_type": "public"-}+}\ No newline at end of filediff --git a/packages/utils/src/constants/misc.ts b/packages/utils/src/constants/misc.tsindex 4e57676476..abac1e8181 100644--- a/packages/utils/src/constants/misc.ts+++ b/packages/utils/src/constants/misc.ts@@ -33,3 +33,6 @@ export const PAGINATION_LIMIT = 100;export const TWO_WEEKS_IN_SECONDS = 60 * 60 * 24 * 14;export const DUB_FOUNDING_DATE = new Date("2022-09-22T00:00:00.000Z");++export const SLACK_INTEGRATION_ID = "clzu59rx9000110bm5fnlzwuj";+export const STRIPE_INTEGRATION_ID = "clzra1ya60001wnj4a89zcg9h";