Skip to content

Commit

Permalink
fix: clients should not be able to view canceled invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanherwijnen committed Aug 15, 2024
1 parent 91d42f3 commit f538001
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/api/src/trpc/public/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ export const publicInvoiceRoutes = ({
withAmountRefunded: true
}
})
if (invoice?.status !== 'concept') return invoice
if (
invoice?.status &&
![InvoiceStatus.CONCEPT, InvoiceStatus.CANCELED].includes(
invoice.status
)
)
return invoice
}
throw new TRPCError({
code: 'BAD_REQUEST'
Expand Down

0 comments on commit f538001

Please sign in to comment.