Skip to content

Commit 1b12316

Browse files
committed
fix(headlines-search): remove pagination for country searches
- Remove pagination options when searching countries with 'eventCountry' usage - Add comment explaining that pagination is not supported when 'usage' is set - Update both async and non-async method calls in HeadlinesSearchBloc
1 parent eaf4c68 commit 1b12316

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/headlines-search/bloc/headlines_search_bloc.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,10 @@ class HeadlinesSearchBloc
178178
// both the search term for the country's name and a 'usage'
179179
// of 'eventCountry'. This ensures that only countries for which
180180
// there are associated headlines are returned.
181+
//
182+
// whene usage is set, pagination is not supported by the backend.
181183
response = await _countryRepository.readAll(
182184
filter: {'q': searchTerm, 'usage': 'eventCountry'},
183-
pagination: PaginationOptions(
184-
limit: _limit,
185-
cursor: successState.cursor,
186-
),
187185
sort: [const SortOption('name', SortOrder.asc)],
188186
);
189187
emit(
@@ -271,9 +269,10 @@ class HeadlinesSearchBloc
271269
// both the search term for the country's name and a 'usage'
272270
// of 'eventCountry'. This ensures that only countries for which
273271
// there are associated headlines are returned.
272+
//
273+
// whene usage is set, pagination is not supported by the backend.
274274
rawResponse = await _countryRepository.readAll(
275275
filter: {'q': searchTerm, 'usage': 'eventCountry'},
276-
pagination: const PaginationOptions(limit: _limit),
277276
sort: [const SortOption('name', SortOrder.asc)],
278277
);
279278
processedItems = rawResponse.items.cast<FeedItem>();

0 commit comments

Comments
 (0)