Skip to content

fix(content_management): update sort order to descending for reposito… #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class CreateHeadlineBloc
countriesResponse,
] = await Future.wait([
_sourcesRepository.readAll(
sort: [const SortOption('updatedAt', SortOrder.asc)],
sort: [const SortOption('updatedAt', SortOrder.desc)],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider defining a constant for the sort option to improve maintainability and prevent potential typos. Using a named constant, such as const defaultSort = [SortOption('updatedAt', SortOrder.desc)];, can enhance code clarity.

),
_topicsRepository.readAll(
sort: [const SortOption('updatedAt', SortOrder.asc)],
sort: [const SortOption('updatedAt', SortOrder.desc)],
),
_countriesRepository.readAll(
sort: [const SortOption('updatedAt', SortOrder.asc)],
sort: [const SortOption('updatedAt', SortOrder.desc)],
),
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
emit(state.copyWith(status: CreateSourceStatus.loading));
try {
final countriesResponse = await _countriesRepository.readAll(
sort: [const SortOption('updatedAt', SortOrder.asc)],
sort: [const SortOption('updatedAt', SortOrder.desc)],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider defining a constant for the sort option to improve maintainability and prevent potential typos. Using a named constant, such as const defaultSort = [SortOption('updatedAt', SortOrder.desc)];, can enhance code clarity.

);
final countries = countriesResponse.items;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ class EditHeadlineBloc extends Bloc<EditHeadlineEvent, EditHeadlineState> {
] = await Future.wait([
_headlinesRepository.read(id: _headlineId),
_sourcesRepository.readAll(
sort: [const SortOption('updatedAt', SortOrder.asc)],
sort: [const SortOption('updatedAt', SortOrder.desc)],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider defining a constant for the sort option to improve maintainability and prevent potential typos. Using a named constant, such as const defaultSort = [SortOption('updatedAt', SortOrder.desc)];, can enhance code clarity.

),
_topicsRepository.readAll(
sort: [const SortOption('updatedAt', SortOrder.asc)],
sort: [const SortOption('updatedAt', SortOrder.desc)],
),
_countriesRepository.readAll(
sort: [const SortOption('updatedAt', SortOrder.asc)],
sort: [const SortOption('updatedAt', SortOrder.desc)],
),
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
final [sourceResponse, countriesResponse] = await Future.wait([
_sourcesRepository.read(id: _sourceId),
_countriesRepository.readAll(
sort: [const SortOption('updatedAt', SortOrder.asc)],
sort: [const SortOption('updatedAt', SortOrder.desc)],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider defining a constant for the sort option to improve maintainability and prevent potential typos. Using a named constant, such as const defaultSort = [SortOption('updatedAt', SortOrder.desc)];, can enhance code clarity.

),
]);
final source = sourceResponse as Source;
Expand Down
Loading