Skip to content

Commit b5039a4

Browse files
committed
fix(headlines-search): remove 'usage' filter for country search
- Remove the 'usage' filter parameter for country searches in both readAll calls. - This change allows pagination to work correctly for country searches.
1 parent 1b12316 commit b5039a4

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

lib/headlines-search/bloc/headlines_search_bloc.dart

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,8 @@ class HeadlinesSearchBloc
174174
),
175175
);
176176
case ContentType.country:
177-
// When searching for countries, apply a filter that includes
178-
// both the search term for the country's name and a 'usage'
179-
// of 'eventCountry'. This ensures that only countries for which
180-
// there are associated headlines are returned.
181-
//
182-
// whene usage is set, pagination is not supported by the backend.
183177
response = await _countryRepository.readAll(
184-
filter: {'q': searchTerm, 'usage': 'eventCountry'},
178+
filter: {'q': searchTerm},
185179
sort: [const SortOption('name', SortOrder.asc)],
186180
);
187181
emit(
@@ -265,14 +259,8 @@ class HeadlinesSearchBloc
265259
);
266260
processedItems = rawResponse.items.cast<FeedItem>();
267261
case ContentType.country:
268-
// When searching for countries, apply a filter that includes
269-
// both the search term for the country's name and a 'usage'
270-
// of 'eventCountry'. This ensures that only countries for which
271-
// there are associated headlines are returned.
272-
//
273-
// whene usage is set, pagination is not supported by the backend.
274262
rawResponse = await _countryRepository.readAll(
275-
filter: {'q': searchTerm, 'usage': 'eventCountry'},
263+
filter: {'q': searchTerm},
276264
sort: [const SortOption('name', SortOrder.asc)],
277265
);
278266
processedItems = rawResponse.items.cast<FeedItem>();

0 commit comments

Comments
 (0)