fix: Do not return invoices if there is no subscription
This commit is contained in:
@@ -7,6 +7,11 @@ const getInvoices = async (
|
|||||||
context: Context
|
context: Context
|
||||||
) => {
|
) => {
|
||||||
const subscription = await context.currentUser.$relatedQuery('subscription');
|
const subscription = await context.currentUser.$relatedQuery('subscription');
|
||||||
|
|
||||||
|
if (!subscription) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const invoices = await Billing.paddleClient.getInvoices(
|
const invoices = await Billing.paddleClient.getInvoices(
|
||||||
Number(subscription.paddleSubscriptionId)
|
Number(subscription.paddleSubscriptionId)
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user