@@ -59,21 +59,21 @@ export const useProductsStore = defineStore("products", {
59
59
} ) ;
60
60
} ,
61
61
getUniqueProductTypes ( state ) {
62
- const productTypes = state . products . flatMap ( p => p . productCategories . nodes ) ;
63
- const unique = [ ] ;
64
- const map = new Map ( ) ;
65
- for ( const item of productTypes ) {
66
- if ( ! map . has ( item . id ) ) {
67
- map . set ( item . id , true ) ;
68
- unique . push ( {
69
- id : item . id ,
70
- name : item . name ,
71
- checked : false
72
- } ) ;
73
- }
62
+ const productTypes = state . products . flatMap ( ( p ) => p . productCategories . nodes ) ;
63
+ const unique = [ ] ;
64
+ const map = new Map ( ) ;
65
+ for ( const item of productTypes ) {
66
+ if ( ! map . has ( item . id ) ) {
67
+ map . set ( item . id , true ) ;
68
+ unique . push ( {
69
+ id : item . id ,
70
+ name : item . name ,
71
+ checked : false ,
72
+ } ) ;
74
73
}
75
- return unique ;
76
- }
74
+ }
75
+ return unique ;
76
+ } ,
77
77
} ,
78
78
79
79
actions : {
@@ -104,16 +104,16 @@ export const useProductsStore = defineStore("products", {
104
104
this . priceRange = range ;
105
105
} ,
106
106
toggleProductType ( id ) {
107
- const productType = this . productTypes . find ( pt => pt . id === id ) ;
108
- if ( productType ) {
109
- productType . checked = ! productType . checked ;
110
- }
107
+ const productType = this . productTypes . find ( ( pt ) => pt . id === id ) ;
108
+ if ( productType ) {
109
+ productType . checked = ! productType . checked ;
110
+ }
111
111
} ,
112
112
resetFilters ( ) {
113
- this . selectedSizes = [ ] ;
114
- this . selectedColors = [ ] ;
115
- this . priceRange = [ 0 , 1000 ] ;
116
- this . productTypes . forEach ( pt => pt . checked = false ) ;
117
- }
113
+ this . selectedSizes = [ ] ;
114
+ this . selectedColors = [ ] ;
115
+ this . priceRange = [ 0 , 1000 ] ;
116
+ this . productTypes . forEach ( ( pt ) => ( pt . checked = false ) ) ;
117
+ } ,
118
118
} ,
119
119
} ) ;
0 commit comments