Skip to content

Commit dfbdbd0

Browse files
authored
use supportPlan instead of billingPlan for support tickets (#6228)
1 parent 66bbedb commit dfbdbd0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

apps/dashboard/src/@/api/team.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type Team = {
2424
image?: string;
2525
billingPlan: "pro" | "growth" | "free" | "starter";
2626
billingStatus: "validPayment" | (string & {}) | null;
27+
supportPlan: "pro" | "growth" | "free" | "starter";
2728
billingEmail: string | null;
2829
growthTrialEligible: false;
2930
enabledScopes: EnabledTeamScope[];

apps/dashboard/src/app/(dashboard)/support/create-ticket/components/create-ticket.action.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ export async function createTicketAction(
9898
loginRedirect("/support");
9999
}
100100

101-
const customerId = isValidPlan(team.billingPlan)
102-
? planToCustomerId[team.billingPlan]
103-
: undefined;
101+
const customerId = isValidPlan(team.supportPlan)
102+
? planToCustomerId[team.supportPlan]
103+
: // fallback to "free" tier
104+
planToCustomerId.free;
104105

105106
const product = formData.get("product")?.toString() || "";
106107
const problemArea = formData.get("extraInfo_Problem_Area")?.toString() || "";

apps/dashboard/src/stories/stubs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export function teamStub(id: string, billingPlan: Team["billingPlan"]): Team {
3636
const team: Team = {
3737
id: `team-${id}-id`,
3838
billingPlan: billingPlan,
39+
supportPlan: billingPlan,
3940
billingStatus: "validPayment",
4041
name: `Team ${id}`,
4142
slug: `team-${id}`,

0 commit comments

Comments
 (0)