fix: handle billingSubscriptions gql field if billing is disabled (#9767)
Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
This commit is contained in:
@ -167,6 +167,10 @@ export class WorkspaceResolver {
|
|||||||
async billingSubscriptions(
|
async billingSubscriptions(
|
||||||
@Parent() workspace: Workspace,
|
@Parent() workspace: Workspace,
|
||||||
): Promise<BillingSubscription[] | undefined> {
|
): Promise<BillingSubscription[] | undefined> {
|
||||||
|
if (!this.environmentService.get('IS_BILLING_ENABLED')) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return this.billingSubscriptionRepository.find({
|
return this.billingSubscriptionRepository.find({
|
||||||
where: { workspaceId: workspace.id },
|
where: { workspaceId: workspace.id },
|
||||||
|
|||||||
Reference in New Issue
Block a user