Keep invoiceninja API v4 compatibility for invoice number query param

This commit is contained in:
CodeShakingSheep 2024-06-02 16:08:11 -05:00
parent 3c3e77bcc4
commit 089d4658d7

View file

@ -553,7 +553,12 @@ export class InvoiceNinja implements INodeType {
qs.include = options.include as string;
}
if (options.invoiceNumber) {
qs.number = options.invoiceNumber as string;
if (apiVersion === 'v4') {
qs.invoice_number = options.invoiceNumber as string;
} else if (apiVersion === 'v5') {
// eslint-disable-next-line id-denylist
qs.number = options.invoiceNumber as string;
}
}
if (options.status) {
qs.status = options.status as string;