Updated groups to be public
• Updated: - groups to be public - routes for /group and /groups/id to be public - GroupTimeline to ignore relationships for loading - Group fetching to be a where with is_archived: false - GroupControllers to have if current_user, else • Added: - Meta and og information for view - Group fetch - public route api for featured groups, group timelines • Removed: - Doorkeeper for read:groups
This commit is contained in:
@@ -5,6 +5,7 @@ class ReactController < ApplicationController
|
||||
before_action :set_referrer_policy_header, only: :react
|
||||
before_action :set_initial_state_json, only: :react
|
||||
before_action :set_data_for_meta, only: :react
|
||||
before_action :set_instance_presenter
|
||||
|
||||
def react
|
||||
#
|
||||
@@ -13,9 +14,12 @@ class ReactController < ApplicationController
|
||||
private
|
||||
|
||||
def set_data_for_meta
|
||||
return if find_route_matches
|
||||
return if find_route_matches && current_account
|
||||
|
||||
if find_public_route_matches
|
||||
if request.path.include?("/groups/")
|
||||
groupIdFromPath = request.path.sub("/groups", "").gsub("/", "")
|
||||
@group = Group.where(id: groupIdFromPath, is_archived: false).first
|
||||
elsif find_public_route_matches
|
||||
return
|
||||
elsif request.path.count("/") == 1 && !request.path.include?("@")
|
||||
acctFromPath = request.path.sub("/", "")
|
||||
@@ -40,7 +44,7 @@ class ReactController < ApplicationController
|
||||
end
|
||||
|
||||
def find_public_route_matches
|
||||
request.path.match(/\A\/(about|search|explore)/)
|
||||
request.path.match(/\A\/(about|search|groups|explore)/)
|
||||
end
|
||||
|
||||
def set_initial_state_json
|
||||
@@ -67,4 +71,8 @@ class ReactController < ApplicationController
|
||||
def set_referrer_policy_header
|
||||
response.headers['Referrer-Policy'] = 'origin'
|
||||
end
|
||||
|
||||
def set_instance_presenter
|
||||
@instance_presenter = InstancePresenter.new
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user