Skip to content

Commit 6153f23

Browse files
committed
refactor(user_management): remove unused buildFilterMap function
- Remove the unused buildFilterMap method from the UserFilterBloc class - This function was likely intended to build a filter map for querying the data repository, but it is no longer needed in its current form
1 parent df5f1e9 commit 6153f23

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

lib/user_management/bloc/user_filter/user_filter_bloc.dart

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -54,48 +54,4 @@ class UserFilterBloc extends Bloc<UserFilterEvent, UserFilterState> {
5454
),
5555
);
5656
}
57-
58-
/// Builds the filter map for the data repository query.
59-
Map<String, dynamic> buildFilterMap() {
60-
final filter = <String, dynamic>{};
61-
62-
if (state.searchQuery.isNotEmpty) {
63-
filter[r'$or'] = [
64-
{
65-
'email': {r'$regex': state.searchQuery, r'$options': 'i'},
66-
},
67-
{'_id': state.searchQuery},
68-
];
69-
}
70-
71-
final appRoleFilter = <String>[];
72-
switch (state.authenticationFilter) {
73-
case AuthenticationFilter.authenticated:
74-
appRoleFilter.addAll(
75-
[AppUserRole.standardUser.name, AppUserRole.premiumUser.name],
76-
);
77-
case AuthenticationFilter.anonymous:
78-
appRoleFilter.add(AppUserRole.guestUser.name);
79-
case AuthenticationFilter.all:
80-
break;
81-
}
82-
83-
final subscriptionRoles = <String>{};
84-
switch (state.subscriptionFilter) {
85-
case SubscriptionFilter.premium:
86-
subscriptionRoles.add(AppUserRole.premiumUser.name);
87-
case SubscriptionFilter.free:
88-
subscriptionRoles.addAll(
89-
[AppUserRole.guestUser.name, AppUserRole.standardUser.name],
90-
);
91-
case SubscriptionFilter.all:
92-
break;
93-
}
94-
95-
if (appRoleFilter.isNotEmpty) {
96-
filter['appRole'] = {r'$in': appRoleFilter.toList()};
97-
}
98-
99-
return filter;
100-
}
10157
}

0 commit comments

Comments
 (0)