summaryrefslogtreecommitdiff
path: root/lib/api/invitations.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/invitations.rb')
-rw-r--r--lib/api/invitations.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/api/invitations.rb b/lib/api/invitations.rb
index 46d8c0c958d..1f437ad5bd3 100644
--- a/lib/api/invitations.rb
+++ b/lib/api/invitations.rb
@@ -24,6 +24,7 @@ module API
requires :access_level, type: Integer, values: Gitlab::Access.all_values, desc: 'A valid access level (defaults: `30`, developer access level)'
optional :expires_at, type: DateTime, desc: 'Date string in the format YEAR-MONTH-DAY'
optional :invite_source, type: String, desc: 'Source that triggered the member creation process', default: 'invitations-api'
+ optional :areas_of_focus, type: Array[String], coerce_with: Validations::Types::CommaSeparatedToArray.coerce, desc: 'Areas the inviter wants the member to focus upon'
end
post ":id/invitations" do
params[:source] = find_source(source_type, params[:id])
@@ -54,11 +55,11 @@ module API
success Entities::Member
end
params do
- requires :email, type: String, desc: 'The email address of the invitation.'
- optional :access_level, type: Integer, values: Gitlab::Access.all_values, desc: 'A valid access level (defaults: `30`, developer access level).'
- optional :expires_at, type: DateTime, desc: 'Date string in ISO 8601 format (`YYYY-MM-DDTHH:MM:SSZ`).'
+ requires :email, type: String, desc: 'The email address of the invitation'
+ optional :access_level, type: Integer, values: Gitlab::Access.all_values, desc: 'A valid access level (defaults: `30`, developer access level)'
+ optional :expires_at, type: DateTime, desc: 'Date string in ISO 8601 format (`YYYY-MM-DDTHH:MM:SSZ`)'
end
- put ":id/invitations/:email", requirements: { email: /[^\/]+/ } do
+ put ":id/invitations/:email", requirements: { email: %r{[^/]+} } do
source = find_source(source_type, params.delete(:id))
invite_email = params[:email]
authorize_admin_source!(source_type, source)
@@ -87,7 +88,7 @@ module API
params do
requires :email, type: String, desc: 'The email address of the invitation'
end
- delete ":id/invitations/:email", requirements: { email: /[^\/]+/ } do
+ delete ":id/invitations/:email", requirements: { email: %r{[^/]+} } do
source = find_source(source_type, params[:id])
invite_email = params[:email]
authorize_admin_source!(source_type, source)