Skip to content

Commit f760a8a

Browse files
authored
refactor: only check platform billing for platforms (#15507)
1 parent d0a7eb1 commit f760a8a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

apps/web/components/settings/platform/hooks/useGetUserAttributes.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { useCheckTeamBilling } from "@calcom/web/lib/hooks/settings/platform/oau
44
export const useGetUserAttributes = () => {
55
const { data: user, isLoading: isUserLoading } = useMeQuery();
66
const { data: userBillingData, isFetching: isUserBillingDataLoading } = useCheckTeamBilling(
7-
user?.organizationId
7+
user?.organizationId,
8+
user?.organization.isPlatform
89
);
910
const isPlatformUser = user?.organization.isPlatform;
1011
const isPaidUser = userBillingData?.valid;

apps/web/lib/hooks/settings/platform/oauth-clients/usePersistOAuthClient.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export const useDeleteOAuthClient = (
119119
return mutation;
120120
};
121121

122-
export const useCheckTeamBilling = (teamId?: number | null) => {
122+
export const useCheckTeamBilling = (teamId?: number | null, isPlatformTeam?: boolean | null) => {
123123
const QUERY_KEY = "check-team-billing";
124124
const isTeamBilledAlready = useQuery({
125125
queryKey: [QUERY_KEY, teamId],
@@ -132,7 +132,7 @@ export const useCheckTeamBilling = (teamId?: number | null) => {
132132

133133
return data.data;
134134
},
135-
enabled: !!teamId,
135+
enabled: !!teamId && !!isPlatformTeam,
136136
});
137137

138138
return isTeamBilledAlready;

0 commit comments

Comments
 (0)