Unverified Commit 76232d54 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Use AccessRequestable#request_access in MembershipActions


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent b67786d17508
......@@ -3,7 +3,7 @@ module MembershipActions
include MembersHelper
def request_access
Members::RequestAccessService.new(membershipable, current_user).execute
membershipable.request_access(current_user)
redirect_to polymorphic_path(membershipable),
notice: 'Your request for access has been queued for review.'
......
......@@ -33,7 +33,7 @@ class AccessRequests < Grape::API
# POST /projects/:id/access_requests
post ":id/access_requests" do
source = find_source(source_type, params[:id])
access_requester = ::Members::RequestAccessService.new(source, current_user).execute
access_requester = source.request_access(current_user)
if access_requester.persisted?
present access_requester.user, with: Entities::AccessRequester, access_requester: access_requester
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment