From 570b864447f997a466885c211050067d28f201d3 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 12 Jul 2022 14:13:46 +0300 Subject: [PATCH] process/init: add evo_graph_price to label --- process/init/get-data.ts | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/process/init/get-data.ts b/process/init/get-data.ts index 5b8d51d..6f87b85 100644 --- a/process/init/get-data.ts +++ b/process/init/get-data.ts @@ -191,21 +191,33 @@ export async function getCRMData(apolloClient: ApolloClient, us query: QUERY_GET_ADDPRODUCT_TYPES, }); - const selectRegistration = addproductTypes.evo_addproduct_types?.filter( - (x) => x?.evo_product_type === 100_000_001 - ); + const selectRegistration = addproductTypes.evo_addproduct_types + ?.filter((x) => x?.evo_product_type === 100_000_001) + .map((x) => ({ + ...x, + label: `${x?.label} (${x?.evo_graph_price} руб.)`, + })); - const selectTechnicalCard = addproductTypes.evo_addproduct_types?.filter( - (x) => x?.evo_product_type === 100_000_000 - ); + const selectTechnicalCard = addproductTypes.evo_addproduct_types + ?.filter((x) => x?.evo_product_type === 100_000_000) + .map((x) => ({ + ...x, + label: `${x?.label} (${x?.evo_graph_price} руб.)`, + })); - const selectTelematic = addproductTypes.evo_addproduct_types?.filter( - (x) => x?.evo_product_type === 100_000_004 - ); + const selectTelematic = addproductTypes.evo_addproduct_types + ?.filter((x) => x?.evo_product_type === 100_000_004) + .map((x) => ({ + ...x, + label: `${x?.label} (${x?.evo_graph_price} руб.)`, + })); - const selectTracker = addproductTypes.evo_addproduct_types?.filter( - (x) => x?.evo_product_type === 100_000_003 - ); + const selectTracker = addproductTypes.evo_addproduct_types + ?.filter((x) => x?.evo_product_type === 100_000_003) + .map((x) => ({ + ...x, + label: `${x?.label} (${x?.evo_graph_price} руб.)`, + })); const selectNSIB = addproductTypes.evo_addproduct_types?.filter( (x) => x?.evo_product_type === 100_000_002