Skip to content
Snippets Groups Projects
Commit c1a37c60 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Use UpdateRunnerService to update runner in API:

TODO: Add tests to make sure controllers and API
would tick the queue.
parent 80bc6659
No related branches found
No related tags found
1 merge request!8664Prefer service object over after_save hook
Pipeline #
Loading
@@ -60,8 +60,9 @@ module API
Loading
@@ -60,8 +60,9 @@ module API
put ':id' do put ':id' do
runner = get_runner(params.delete(:id)) runner = get_runner(params.delete(:id))
authenticate_update_runner!(runner) authenticate_update_runner!(runner)
update_service = Ci::UpdateRunnerService.new(runner)
   
if runner.update(declared_params(include_missing: false)) if update_service.update(declared_params(include_missing: false))
present runner, with: Entities::RunnerDetails, current_user: current_user present runner, with: Entities::RunnerDetails, current_user: current_user
else else
render_validation_error!(runner) render_validation_error!(runner)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment