@@ -11,6 +11,7 @@ export const defaultAppliedFilters: AppliedFiltersModel = {
1111 replenishmentPeriods : [ ] as string [ ] ,
1212 donors : [ ] as string [ ] ,
1313 donorCategories : [ ] as string [ ] ,
14+ donorSubCategories : [ ] as string [ ] ,
1415} ;
1516
1617export interface AppliedFiltersModel {
@@ -23,6 +24,7 @@ export interface AppliedFiltersModel {
2324 replenishmentPeriods : string [ ] ;
2425 donors : string [ ] ;
2526 donorCategories : string [ ] ;
27+ donorSubCategories : string [ ] ;
2628}
2729
2830export interface AppliedFiltersStateModel {
@@ -44,6 +46,8 @@ export interface AppliedFiltersStateModel {
4446 setDonors : Action < AppliedFiltersStateModel , string [ ] > ;
4547 donorCategories : string [ ] ;
4648 setDonorCategories : Action < AppliedFiltersStateModel , string [ ] > ;
49+ donorSubCategories : string [ ] ;
50+ setDonorSubCategories : Action < AppliedFiltersStateModel , string [ ] > ;
4751 setAll : Action < AppliedFiltersStateModel , AppliedFiltersModel > ;
4852 actionDefaultNone : Action < AppliedFiltersStateModel , string [ ] > ;
4953 appliedFiltersCount : number ;
@@ -95,6 +99,11 @@ export const AppliedFiltersState: AppliedFiltersStateModel = {
9599 state . donorCategories = payload ;
96100 state . appliedFiltersCount += payload . length ;
97101 } ) ,
102+ donorSubCategories : [ ] ,
103+ setDonorSubCategories : action ( ( state , payload : string [ ] ) => {
104+ state . donorSubCategories = payload ;
105+ state . appliedFiltersCount += payload . length ;
106+ } ) ,
98107 setAll : action ( ( state , payload : AppliedFiltersModel ) => {
99108 state . locations = payload . locations ;
100109 state . components = payload . components ;
@@ -105,6 +114,7 @@ export const AppliedFiltersState: AppliedFiltersStateModel = {
105114 state . replenishmentPeriods = payload . replenishmentPeriods ;
106115 state . donors = payload . donors ;
107116 state . donorCategories = payload . donorCategories ;
117+ state . donorSubCategories = payload . donorSubCategories ;
108118 state . appliedFiltersCount =
109119 payload . locations . length +
110120 payload . components . length +
0 commit comments