diff --git a/app/controllers/api/v1/channels_controller.rb b/app/controllers/api/v1/channels_controller.rb index d157d964..c7aecfd1 100644 --- a/app/controllers/api/v1/channels_controller.rb +++ b/app/controllers/api/v1/channels_controller.rb @@ -73,12 +73,12 @@ def my_channel end def channel_feeds - channel_feeds = Community.filter_channel_feeds.exclude_incomplete_channels.exclude_deleted_channels.exclude_not_recommended.with_all_includes + channel_feeds = Community.filter_channel_feeds.exclude_incomplete_channels.exclude_deleted_channels.exclude_not_recommended.with_all_includes.ordered_pos_name render json: Api::V1::ChannelSerializer.new(channel_feeds , { params: { current_account: current_account } }).serializable_hash.to_json end def newsmast_channels - newsmast_channels = Community.filter_newsmast_channels.exclude_incomplete_channels.exclude_deleted_channels.exclude_not_recommended.with_all_includes + newsmast_channels = Community.filter_newsmast_channels.exclude_incomplete_channels.exclude_deleted_channels.exclude_not_recommended.with_all_includes.ordered_pos_name if newsmast_channels.present? render json: Api::V1::ChannelSerializer.new(newsmast_channels , { params: { current_account: current_remote_account } }).serializable_hash.to_json else diff --git a/app/models/community.rb b/app/models/community.rb index 28069811..e5eea206 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -215,7 +215,7 @@ def formatted_error_messages .order('patchwork_community_types.sorting_index ASC') } - scope :ordered_pos_name, -> { order('patchwork_communities.position ASC, patchwork_communities.name ASC') } + scope :ordered_pos_name, -> { order('patchwork_communities.name ASC') } scope :filter_channels, -> { where(patchwork_communities: { channel_type: Community.channel_types[:channel] }).exclude_deleted_channels }