IO-2801 os-loader bills data

add in job object to bills in opensearch for ro_number to be searchable again

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
Allan Carr
2024-06-03 11:50:44 -07:00
parent 6dc03d7f67
commit 7b99de8046

View File

@@ -174,10 +174,7 @@ async function OpenSearchUpdateHandler(req, res) {
const bulkOperation = []; const bulkOperation = [];
slicedArray.forEach((bill) => { slicedArray.forEach((bill) => {
bulkOperation.push({ index: { _index: "bills", _id: bill.id } }); bulkOperation.push({ index: { _index: "bills", _id: bill.id } });
bulkOperation.push({ bulkOperation.push({ ...bill, bodyshopid: bill.job.bodyshopid });
...omit(bill, ["job"]),
bodyshopid: bill.job.bodyshopid
});
}); });
promiseQueue.push(bulkOperation); promiseQueue.push(bulkOperation);
} }