From a065d0e603ed44054f38829a992ecdfb57a301c6 Mon Sep 17 00:00:00 2001 From: Nastya Date: Wed, 5 Jul 2023 04:18:02 +0300 Subject: [PATCH] render in DG rows values --- .../Content/DiscountManagement/DiscountDataGrid.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/dashboard/Content/DiscountManagement/DiscountDataGrid.tsx b/src/pages/dashboard/Content/DiscountManagement/DiscountDataGrid.tsx index 15719c8..5c43d86 100644 --- a/src/pages/dashboard/Content/DiscountManagement/DiscountDataGrid.tsx +++ b/src/pages/dashboard/Content/DiscountManagement/DiscountDataGrid.tsx @@ -112,16 +112,18 @@ export default function DiscountDataGrid() { useDiscounts({ onNewDiscounts: setDiscounts }); - const rowBackDicounts: GridRowsProp = realDiscounts.filter(e => e.Layer > 0).map(discount => ({ + const rowBackDicounts: GridRowsProp = realDiscounts.filter(e => e.Layer > 0).map(discount => { + console.log(discount.Condition[layerValue[discount.Layer] as keyof typeof discount.Condition]) + return({ id: discount.ID, name: discount.Name, description: discount.Description, conditionType: layerTranslate[discount.Layer], factor: formatDiscountFactor(discount.Target.Factor), - value: layerValue[discount.Layer], + value: discount.Condition[layerValue[discount.Layer] as keyof typeof discount.Condition], active: discount.Deprecated ? "🚫" : "✅", deleted: discount.Audit.Deleted, - })); + })}); return (