From e8b605968e9a53a7f62b1104cc8b3b241cfad66a Mon Sep 17 00:00:00 2001 From: gbuomprisco Date: Mon, 8 Jul 2024 19:40:07 +0800 Subject: [PATCH] Update subscription query in team-accounts API The data selection in the getSubscription API for team-accounts has been updated. The query now retrieves all items related to the subscription by implementing an inner join within the 'subscription_items' table. --- packages/features/team-accounts/src/server/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/features/team-accounts/src/server/api.ts b/packages/features/team-accounts/src/server/api.ts index 0037ab767..f57ad90c0 100644 --- a/packages/features/team-accounts/src/server/api.ts +++ b/packages/features/team-accounts/src/server/api.ts @@ -56,7 +56,7 @@ export class TeamAccountsApi { async getSubscription(accountId: string) { const { data, error } = await this.client .from('subscriptions') - .select('*') + .select('*, items: subscription_items !inner (*)') .eq('account_id', accountId) .maybeSingle();