Skip to content

Commit 39279bb

Browse files
fix: add statuses input to admin getInvoices
1 parent 52a57a3 commit 39279bb

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/api/src/trpc/admin/invoices.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ export const adminInvoiceRoutes = ({
251251
})
252252
.nullable()
253253
.optional(),
254-
status: z.nativeEnum(InvoiceStatus).nullable(),
254+
status: z.enum(InvoiceStatus).optional(),
255+
statuses: z.enum(InvoiceStatus).array().optional(),
255256
pagination: z
256257
.object({
257258
limit: z.number(),
@@ -276,6 +277,7 @@ export const adminInvoiceRoutes = ({
276277
clientId,
277278
clientDetails,
278279
status,
280+
statuses,
279281
pagination,
280282
paid
281283
} = input || {}
@@ -286,6 +288,7 @@ export const adminInvoiceRoutes = ({
286288
clientId,
287289
clientDetails,
288290
status,
291+
statuses,
289292
options: {
290293
withPayments: true,
291294
withAmountPaid: true,

packages/app/src/queries/admin/invoices.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export const useAdminGetInvoicesQuery = defineQuery(() => {
1919
| InvoiceStatus.PAID
2020
| InvoiceStatus.CONCEPT
2121
| InvoiceStatus.CANCELED
22-
| null
23-
>(null)
22+
>()
2423
const pagination = computed<{
2524
limit: number
2625
offset: number

0 commit comments

Comments
 (0)