invantory fixed

This commit is contained in:
Sibunnayak 2024-10-11 11:41:09 +05:30
parent 5279bc91ef
commit 54b64f5b64
2 changed files with 3 additions and 6 deletions

View File

@ -33,15 +33,12 @@ const Inventory = () => {
name: nameRef.current?.value || "", name: nameRef.current?.value || "",
}, },
}); });
// console.log("response", response);
const transformedData = const transformedData =
response.data?.inventories?.map((entry) => ({ response.data?.inventories?.map((entry) => ({
id: entry._id, id: entry._id,
uniqueId: entry.uniqueId, uniqueId: entry.uniqueId,
tradeName: tradeName: entry.tradeName || "N/A",
entry.addedForData?.shippingAddress?.tradeName ||
entry.addedForData?.trade_name ||
"N/A",
designation: entry.addedFor === "PrincipalDistributor" ? "PD" : "RD", designation: entry.addedFor === "PrincipalDistributor" ? "PD" : "RD",
products: entry.products.map((product) => ({ products: entry.products.map((product) => ({
SKU: product.SKU, SKU: product.SKU,

View File

@ -140,7 +140,7 @@ const SingleInventory = () => {
</Typography> </Typography>
<Typography> <Typography>
<strong>Trade Name:</strong>{" "} <strong>Trade Name:</strong>{" "}
{inventoryDetails.addedForData.shippingAddress?.tradeName||inventoryDetails.addedForData.trade_name} {inventoryDetails.addedForData.shippingAddress?.tradeName||inventoryDetails.addedForData.kyc.trade_name}
</Typography> </Typography>
</Grid> </Grid>
</Grid> </Grid>