gab-social/app/presenters/group_relationships_presenter.rb
mgabdev 217aab9faa Added join requests to Groups
• Added:
- join requests to Groups
- redux actions, reducers
- controller and functionality for fetching join requests, accepting, rejecting join requests
2020-09-10 17:07:00 -05:00

16 lines
620 B
Ruby

# frozen_string_literal: true
class GroupRelationshipsPresenter
attr_reader :member, :admin, :moderator, :requested
def initialize(group_ids, current_account_id, **options)
@group_ids = group_ids.map { |a| a.is_a?(Group) ? a.id : a }
@current_account_id = current_account_id
@member = Group.member_map(@group_ids, @current_account_id)
@admin = Group.admin_map(@group_ids, @current_account_id)
@moderator = Group.moderator_map(@group_ids, @current_account_id)
@requested = Group.requested_map(@group_ids, @current_account_id)
end
end