File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ interface ITeamWithDomain {
17
17
teamId : string ;
18
18
userId : string ;
19
19
domain ?: string ;
20
+ teamOptions ?: { } ;
20
21
options ?: { } ;
21
22
}
22
23
@@ -97,6 +98,7 @@ export async function getTeamWithDomain({
97
98
teamId,
98
99
userId,
99
100
domain : domainSlug ,
101
+ teamOptions,
100
102
options,
101
103
} : ITeamWithDomain ) {
102
104
const team = await prisma . team . findUnique ( {
@@ -126,6 +128,12 @@ export async function getTeamWithDomain({
126
128
throw new TeamError ( "You are not a member of the team" ) ;
127
129
}
128
130
131
+ // check if the team has a paid plan
132
+ const teamHasPaidPlan = team ?. plan !== "free" ;
133
+ if ( ! teamHasPaidPlan ) {
134
+ throw new TeamError ( "Team doesn't have a paid plan" ) ;
135
+ }
136
+
129
137
// check if the domain exists in the team
130
138
let domain : Domain | undefined ;
131
139
if ( domainSlug ) {
You can’t perform that action at this time.
0 commit comments