diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/api/invitations.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/api/invitations.rb')
-rw-r--r-- | lib/api/invitations.rb | 11 |
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) |