File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ export default {
247
247
} ) ,
248
248
// Products demo for PS version <= 1.7.2
249
249
//@todo : to find for a solution in case of upgrade 1.7.2 to 1.7.8
250
+ //@todo : Clean FakerCartRule & FakerSearchTag
250
251
old_demo_1 : new FakerProduct ( {
251
252
id : 1 ,
252
253
name : 'Faded Short Sleeves T-shirt' ,
Original file line number Diff line number Diff line change @@ -10,7 +10,14 @@ import type {
10
10
11
11
import { faker } from '@faker-js/faker' ;
12
12
13
- const productsNames : string [ ] = Object . values ( dataProducts ) . map ( ( product : FakerProduct ) => product . name ) ;
13
+ const productsNames : string [ ] = Object . entries ( dataProducts )
14
+ . map ( ( value : [ string , FakerProduct ] ) => {
15
+ if ( value [ 0 ] . startsWith ( 'old_' ) ) {
16
+ return '' ;
17
+ }
18
+ return value [ 1 ] . name ;
19
+ } )
20
+ . filter ( ( value : string ) => value !== '' ) ;
14
21
15
22
/**
16
23
* Create new cart rule to use on creation cart rule form on BO
Original file line number Diff line number Diff line change @@ -6,7 +6,14 @@ import SearchTagCreator from '@data/types/searchTag';
6
6
7
7
import { faker } from '@faker-js/faker' ;
8
8
9
- const productsNames : string [ ] = Object . values ( dataProducts ) . map ( ( product : FakerProduct ) => product . name ) ;
9
+ const productsNames : string [ ] = Object . entries ( dataProducts )
10
+ . map ( ( value : [ string , FakerProduct ] ) => {
11
+ if ( value [ 0 ] . startsWith ( 'old_' ) ) {
12
+ return '' ;
13
+ }
14
+ return value [ 1 ] . name ;
15
+ } )
16
+ . filter ( ( value : string ) => value !== '' ) ;
10
17
const languagesNames : string [ ] = Object . values ( dataLanguages ) . map ( ( language : FakerLanguage ) => language . name ) ;
11
18
12
19
/**
You can’t perform that action at this time.
0 commit comments