Updated Group/Collection,Pins controllers to require user for API

• Updated:
- Group/Collection,Pins controllers to require user for API
This commit is contained in:
mgabdev 2021-01-13 21:45:03 -05:00
parent 6e475f66cb
commit 25297df30f
3 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
class Api::V1::Timelines::GroupCollectionController < Api::BaseController class Api::V1::Timelines::GroupCollectionController < Api::BaseController
before_action :require_user!
before_action :set_collection_type before_action :set_collection_type
before_action :set_sort_type before_action :set_sort_type
before_action :set_statuses before_action :set_statuses
@ -71,8 +72,9 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController
FeedManager.instance.filter?(:home, status, current_account.id) FeedManager.instance.filter?(:home, status, current_account.id)
} }
else else
page = [params[:page].to_i.abs, MIN_UNAUTHENTICATED_PAGES].min return []
SortingQueryBuilder.new.call(@sort_type, @groupIds, page) # page = [params[:page].to_i.abs, MIN_UNAUTHENTICATED_PAGES].min
# SortingQueryBuilder.new.call(@sort_type, @groupIds, page)
end end
end end

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
class Api::V1::Timelines::GroupController < Api::BaseController class Api::V1::Timelines::GroupController < Api::BaseController
before_action :require_user!
before_action :set_group before_action :set_group
before_action :set_sort_type before_action :set_sort_type
before_action :set_statuses before_action :set_statuses

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
class Api::V1::Timelines::GroupPinsController < Api::BaseController class Api::V1::Timelines::GroupPinsController < Api::BaseController
before_action :require_user!
before_action :set_group before_action :set_group
before_action :set_statuses before_action :set_statuses