Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update route.ts

Steven Teyb5d994e8f715
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
index f44ddad907..283d30874e 100644
--- a/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
+++ b/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
@@ -26,12 +26,14 @@ export const POST = withWorkspace(
await req.json(),
);
- let lookupKey = tier > 1 ? `${plan}${tier}_${period}` : `${plan}_${period}`;
-
if (workspace.disabledAt) {
- lookupKey = "advanced_yearly";
+ plan = "advanced";
+ period = "yearly";
}
+ const lookupKey =
+ tier > 1 ? `${plan}${tier}_${period}` : `${plan}_${period}`;
+
const prices = await stripe.prices.list({
lookup_keys: [lookupKey],
});