Skip to content

Commit d71bfb7

Browse files
committed
feat(content_management): sort countries in ascending order when editing source
- Modify the `edit_source_bloc.dart` file to include sorting when fetching countries - Use `SortOption` to sort countries by 'name' in ascending order - Improve user experience by presenting a consistent and organized list of countries
1 parent 6b81b6a commit d71bfb7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/content_management/bloc/edit_source/edit_source_bloc.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
4242
try {
4343
final [sourceResponse, countriesResponse] = await Future.wait([
4444
_sourcesRepository.read(id: _sourceId),
45-
_countriesRepository.readAll(),
45+
_countriesRepository.readAll(
46+
sort: [const SortOption('name', SortOrder.asc)],
47+
),
4648
]);
4749
final source = sourceResponse as Source;
4850
final countries = (countriesResponse as PaginatedResponse<Country>).items;

0 commit comments

Comments
 (0)