Updated invoice route handler to include dynamic reference types for 'to' and 'from' fields, aligning with recent schema changes.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit is contained in:
parent
6e7419da67
commit
99ef989cc5
@ -87,8 +87,8 @@ export const listInvoicesByPropertiesRouteHandler = async (
|
|||||||
export const getInvoiceRouteHandler = async (req, res) => {
|
export const getInvoiceRouteHandler = async (req, res) => {
|
||||||
const id = req.params.id;
|
const id = req.params.id;
|
||||||
const populateFields = [
|
const populateFields = [
|
||||||
{ path: 'to', strictPopulate: false },
|
{ path: 'to', strictPopulate: false, ref: 'toType' },
|
||||||
{ path: 'from', strictPopulate: false },
|
{ path: 'from', strictPopulate: false, ref: 'fromType' },
|
||||||
{ path: 'order' },
|
{ path: 'order' },
|
||||||
{ path: 'invoiceOrderItems.taxRate' },
|
{ path: 'invoiceOrderItems.taxRate' },
|
||||||
{ path: 'invoiceShipments.taxRate' },
|
{ path: 'invoiceShipments.taxRate' },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user