pull
This commit is contained in:
@@ -16,7 +16,7 @@ class Api::V1::GroupsController < Api::BaseController
|
||||
when 'new'
|
||||
@groups = Group.where(is_archived: false).limit(24).order('created_at DESC').all
|
||||
when 'member'
|
||||
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account }).order('group_accounts.unread_count DESC, group_accounts.id DESC').all
|
||||
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account }).order('group_accounts.id DESC').all
|
||||
when 'admin'
|
||||
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account, role: :admin }).all
|
||||
end
|
||||
|
||||
@@ -9,8 +9,6 @@ class Api::V1::Timelines::GroupController < Api::BaseController
|
||||
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
||||
|
||||
def show
|
||||
mark_as_unread
|
||||
|
||||
render json: @statuses,
|
||||
each_serializer: REST::StatusSerializer,
|
||||
relationships: StatusRelationshipsPresenter.new(@statuses, current_user.account_id)
|
||||
@@ -18,10 +16,6 @@ class Api::V1::Timelines::GroupController < Api::BaseController
|
||||
|
||||
private
|
||||
|
||||
def mark_as_unread
|
||||
GroupAccount.where(group: @group, account: current_account).update_all("unread_count = 0")
|
||||
end
|
||||
|
||||
def set_group
|
||||
@group = Group.find(params[:id])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user