diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-02 16:43:25 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-02 16:43:25 +0700 |
| commit | b30e6a53d660f9ccbc0ded640c2a1dc5df673ff2 (patch) | |
| tree | ae840e06b29d9ccdeb88c31b17d1962ebd9f5539 /src/utils | |
| parent | 3f384749fe51a2763e7e99351f36ce70954afb7a (diff) | |
<iman> update fetch data
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/solrMapping.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/utils/solrMapping.js b/src/utils/solrMapping.js index 7a115753..637d7c09 100644 --- a/src/utils/solrMapping.js +++ b/src/utils/solrMapping.js @@ -1,7 +1,6 @@ -export const promoMappingSolr = (promotions, pricelist) => { - const result = []; - for (const promotion of promotions) { - const data = { +export const promoMappingSolr = (promotions) => { + return promotions.map((promotion) =>{ + let productMapped = { id: promotion.id, program_id: promotion.program_id_i, name: promotion.name_s, @@ -20,9 +19,8 @@ export const promoMappingSolr = (promotions, pricelist) => { qty_sold_f:promotion.total_qty_sold_f, free_products: JSON.parse(promotion.free_products_s), }; - result.push(data); - } - return result; + return productMapped; + }) }; |
