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.
This commit is contained in:
gbuomprisco
2024-07-08 19:40:07 +08:00
parent 4c392e02fe
commit e8b605968e

View File

@@ -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();