mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE): Use expedition vendor id fallback in mapping
This commit is contained in:
@@ -235,6 +235,9 @@ const PurchaseOrderAcceptApprovalForm = ({
|
||||
useEffect(() => {
|
||||
if (purchaseItems.length > 0 && initialValues?.items) {
|
||||
const updatedItems = initialValues.items.map((item) => {
|
||||
const expeditionVendorId =
|
||||
item.expedition_vendor_id || item.expedition_vendor?.id || 0;
|
||||
|
||||
return {
|
||||
purchase_item: null,
|
||||
purchase_item_id: item.id,
|
||||
@@ -250,7 +253,7 @@ const PurchaseOrderAcceptApprovalForm = ({
|
||||
label: item.expedition_vendor.name,
|
||||
}
|
||||
: null,
|
||||
expedition_vendor_id: item.expedition_vendor_id || 0,
|
||||
expedition_vendor_id: expeditionVendorId,
|
||||
received_qty: item.total_qty || '',
|
||||
transport_per_item: item.transport_per_item || '',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user