The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Remove yearInReview stuff for now
Steven Tey58287f164f35
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/route.tsindex dcf0c945f5..75e76ba3fc 100644--- a/apps/web/app/api/workspaces/[idOrSlug]/route.ts+++ b/apps/web/app/api/workspaces/[idOrSlug]/route.ts@@ -18,24 +18,16 @@ import { NextResponse } from "next/server";// GET /api/workspaces/[idOrSlug] – get a specific workspace by id or slugexport const GET = withWorkspace(async ({ workspace, headers }) => {- const [domains, yearInReviews] = await Promise.all([- prisma.domain.findMany({- where: {- projectId: workspace.id,- },- select: {- slug: true,- primary: true,- },- take: 100,- }),- prisma.yearInReview.findMany({- where: {- workspaceId: workspace.id,- year: 2024,- },- }),- ]);+ const domains = await prisma.domain.findMany({+ where: {+ projectId: workspace.id,+ },+ select: {+ slug: true,+ primary: true,+ },+ take: 100,+ });const flags = await getFeatureFlags({workspaceId: workspace.id,@@ -53,7 +45,6 @@ export const GET = withWorkspace(linkFolders: flags.linkFolders || workspace.partnersEnabled,},}),- yearInReview: yearInReviews.length > 0 ? yearInReviews[0] : null,},{ headers },);diff --git a/apps/web/app/app.dub.co/(onboarding)/[slug]/wrapped/[year]/client.tsx b/apps/web/app/app.dub.co/(onboarding)/[slug]/wrapped/[year]/client.tsxindex e81ac6cd90..d3fde85fa6 100644--- a/apps/web/app/app.dub.co/(onboarding)/[slug]/wrapped/[year]/client.tsx+++ b/apps/web/app/app.dub.co/(onboarding)/[slug]/wrapped/[year]/client.tsx@@ -17,10 +17,14 @@ import { redirect, useParams } from "next/navigation";export default function WrappedPageClient() {const { slug, year } = useParams();- const { name, logo, yearInReview, loading } = useWorkspace();+ const { name, logo, loading } = useWorkspace();- const { totalLinks, totalClicks, topLinks, topCountries } =- yearInReview || {};+ const { totalLinks, totalClicks, topLinks, topCountries } = {+ totalLinks: 0,+ totalClicks: 0,+ topLinks: [],+ topCountries: [],+ };const stats = {"Total Links": totalLinks,@@ -32,7 +36,9 @@ export default function WrappedPageClient() {count: 0,}));- if (!loading && !yearInReview) {+ // we're redirecting to the dashboard for now+ // for next year's year in review, we can replace true with yearInReview+ if (!loading && true) {redirect(`/${slug}`);}diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.tsindex af138982f2..777a748038 100644--- a/apps/web/lib/types.ts+++ b/apps/web/lib/types.ts@@ -16,7 +16,6 @@ import {User,UtmTemplate,Webhook,- YearInReview,} from "@dub/prisma/client";import {FOLDER_PERMISSIONS,@@ -158,7 +157,6 @@ export type ExpandedWorkspaceProps = WorkspaceProps & {id: string;name: string;}[];- yearInReview: YearInReview | null;allowedHostnames: string[];};diff --git a/apps/web/tests/workspaces/retrieve-workspace.test.ts b/apps/web/tests/workspaces/retrieve-workspace.test.tsindex 0bd45442ac..5beb13c991 100644--- a/apps/web/tests/workspaces/retrieve-workspace.test.ts+++ b/apps/web/tests/workspaces/retrieve-workspace.test.ts@@ -24,7 +24,6 @@ describe("GET /workspaces/{idOrSlug}", async () => {WorkspaceSchema.extend({createdAt: z.string(),- yearInReview: z.object({}).nullable(),}).strict().parse(workspaceFetched);@@ -46,7 +45,6 @@ describe("GET /workspaces/{idOrSlug}", async () => {WorkspaceSchema.extend({createdAt: z.string(),- yearInReview: z.object({}).nullable(),}).strict().parse(workspaceFetched);diff --git a/apps/web/ui/layout/sidebar/year-in-review-card.tsx b/apps/web/ui/layout/sidebar/year-in-review-card.tsxindex b948058bcd..4f9cc5fa7c 100644--- a/apps/web/ui/layout/sidebar/year-in-review-card.tsx+++ b/apps/web/ui/layout/sidebar/year-in-review-card.tsx@@ -8,9 +8,10 @@ import { usePathname } from "next/navigation";export function YearInReviewCard() {const pathname = usePathname();- const { slug, yearInReview } = useWorkspace();+ const { slug } = useWorkspace();- if (!yearInReview) return null;+ // for next year's year in review, we can replace true with yearInReview+ if (true) return null;return (<Link