This commit is contained in:
Mark Chao 2018-05-24 16:59:24 +08:00
parent dc28ef0154
commit 8c24e78b99

View file

@ -41,10 +41,10 @@ module API
requires :name, type: String, desc: 'The name of the protected branch' requires :name, type: String, desc: 'The name of the protected branch'
optional :push_access_level, type: Integer, optional :push_access_level, type: Integer,
values: ProtectedRefAccess::ALLOWED_ACCESS_LEVELS, values: ProtectedRefAccess::ALLOWED_ACCESS_LEVELS,
desc: 'Access levels allowed to push (defaults: `40`, master access level)' desc: 'Access levels allowed to push (defaults: `40`, maintainer access level)'
optional :merge_access_level, type: Integer, optional :merge_access_level, type: Integer,
values: ProtectedRefAccess::ALLOWED_ACCESS_LEVELS, values: ProtectedRefAccess::ALLOWED_ACCESS_LEVELS,
desc: 'Access levels allowed to merge (defaults: `40`, master access level)' desc: 'Access levels allowed to merge (defaults: `40`, maintainer access level)'
end end
post ':id/protected_branches' do post ':id/protected_branches' do
protected_branch = user_project.protected_branches.find_by(name: params[:name]) protected_branch = user_project.protected_branches.find_by(name: params[:name])