fix: invoice URL not working for account under master

This commit is contained in:
John Yeo
2025-11-05 23:01:58 +00:00
parent 4d9adc0ed5
commit dbf8e9938d
2 changed files with 10 additions and 2 deletions

View File

@@ -60,11 +60,17 @@ export class InvoiceService {
with: {
customer: {
with: {
org: true,
org: {
with: {
master: true,
},
},
},
},
},
})) as Invoice & { customer: Customer & { org: Organization } };
})) as Invoice & {
customer: Customer & { org: Organization & { master: Organization } };
};
}
static async list({

View File

@@ -63,10 +63,12 @@ mainRouter.use(
try {
const org = invoice.customer.org;
const env = invoice.customer.env;
const stripeCli = createStripeCli({
org,
env,
});
const stripeInvoice = await stripeCli.invoices.retrieve(
invoice.stripe_id,
);