Renamed ProtectedBranches::ApiUpdateService to LegacyApiUpdateService
This commit is contained in:
parent
e548c61334
commit
fceffe4dca
|
@ -1,9 +1,9 @@
|
|||
# The protected branches API still uses the `developers_can_push` and `developers_can_merge`
|
||||
# The branches#protect API still uses the `developers_can_push` and `developers_can_merge`
|
||||
# flags for backward compatibility, and so performs translation between that format and the
|
||||
# internal data model (separate access levels). The translation code is non-trivial, and so
|
||||
# lives in this service.
|
||||
module ProtectedBranches
|
||||
class ApiCreateService < BaseService
|
||||
class LegacyApiCreateService < BaseService
|
||||
def execute
|
||||
push_access_level =
|
||||
if params.delete(:developers_can_push)
|
|
@ -1,9 +1,9 @@
|
|||
# The protected branches API still uses the `developers_can_push` and `developers_can_merge`
|
||||
# The branches#protect API still uses the `developers_can_push` and `developers_can_merge`
|
||||
# flags for backward compatibility, and so performs translation between that format and the
|
||||
# internal data model (separate access levels). The translation code is non-trivial, and so
|
||||
# lives in this service.
|
||||
module ProtectedBranches
|
||||
class ApiUpdateService < BaseService
|
||||
class LegacyApiUpdateService < BaseService
|
||||
def execute(protected_branch)
|
||||
@developers_can_push = params.delete(:developers_can_push)
|
||||
@developers_can_merge = params.delete(:developers_can_merge)
|
|
@ -81,9 +81,9 @@ module API
|
|||
service_args = [user_project, current_user, protected_branch_params]
|
||||
|
||||
protected_branch = if protected_branch
|
||||
::ProtectedBranches::ApiUpdateService.new(*service_args).execute(protected_branch)
|
||||
::ProtectedBranches::LegacyApiUpdateService.new(*service_args).execute(protected_branch)
|
||||
else
|
||||
::ProtectedBranches::ApiCreateService.new(*service_args).execute
|
||||
::ProtectedBranches::LegacyApiCreateService.new(*service_args).execute
|
||||
end
|
||||
|
||||
if protected_branch.valid?
|
||||
|
|
Loading…
Reference in New Issue