The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update route.ts
Kiran K2bada4777cd4
diff --git a/apps/web/app/(ee)/api/cron/cleanup/e2e-tests/route.ts b/apps/web/app/(ee)/api/cron/cleanup/e2e-tests/route.tsindex e8dc03c570..850ab93096 100644--- a/apps/web/app/(ee)/api/cron/cleanup/e2e-tests/route.ts+++ b/apps/web/app/(ee)/api/cron/cleanup/e2e-tests/route.ts@@ -23,88 +23,83 @@ export async function GET(req: Request) {const oneHourAgo = new Date(Date.now() - 1000 * 60 * 60);- const [links, domains, tags, partners, users, workspace] =- await Promise.all([- prisma.link.findMany({- where: {- userId: E2E_USER_ID,- projectId: E2E_WORKSPACE_ID,- createdAt: {- lt: oneHourAgo,- },- },- include: {- tags: {- select: {- tag: true,- },- },+ const [links, domains, tags, partners, users] = await Promise.all([+ prisma.link.findMany({+ where: {+ userId: E2E_USER_ID,+ projectId: E2E_WORKSPACE_ID,+ createdAt: {+ lt: oneHourAgo,},- take: 100,- }),-- prisma.domain.findMany({- where: {- projectId: E2E_WORKSPACE_ID,- slug: {- endsWith: ".dub-internal-test.com",- },- createdAt: {- lt: oneHourAgo,+ },+ include: {+ tags: {+ select: {+ tag: true,},},- select: {- slug: true,- },- }),+ },+ take: 100,+ }),- prisma.tag.findMany({- where: {- projectId: E2E_WORKSPACE_ID,- name: {- startsWith: "e2e-",- },- createdAt: {- lt: oneHourAgo,- },+ prisma.domain.findMany({+ where: {+ projectId: E2E_WORKSPACE_ID,+ slug: {+ endsWith: ".dub-internal-test.com",},- }),+ createdAt: {+ lt: oneHourAgo,+ },+ },+ select: {+ slug: true,+ },+ }),- prisma.partner.findMany({- where: {- email: {- endsWith: "@dub-internal-test.com",- },- createdAt: {- lt: oneHourAgo,- },+ prisma.tag.findMany({+ where: {+ projectId: E2E_WORKSPACE_ID,+ name: {+ startsWith: "e2e-",},- select: {- id: true,+ createdAt: {+ lt: oneHourAgo,},- }),+ },+ }),- prisma.user.findMany({- where: {- email: {- endsWith: "@dub-internal-test.com",- },- createdAt: {- lt: oneHourAgo,- },+ prisma.partner.findMany({+ where: {+ email: {+ endsWith: "@dub-internal-test.com",},- }),+ createdAt: {+ lt: oneHourAgo,+ },+ },+ select: {+ id: true,+ },+ }),- prisma.project.findUniqueOrThrow({- where: {- id: E2E_WORKSPACE_ID,+ prisma.user.findMany({+ where: {+ email: {+ endsWith: "@dub-internal-test.com",},- select: {- id: true,- stripeConnectId: true,+ createdAt: {+ lt: oneHourAgo,},- }),- ]);+ },+ }),+ ]);++ const workspace = await prisma.project.findUniqueOrThrow({+ where: {+ id: E2E_WORKSPACE_ID,+ },+ });// Delete the linksif (links.length > 0) {