Commit c1a37c60 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Use UpdateRunnerService to update runner in API:

TODO: Add tests to make sure controllers and API
would tick the queue.
parent 80bc6659
......@@ -60,8 +60,9 @@ module API
put ':id' do
runner = get_runner(params.delete(:id))
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
else
render_validation_error!(runner)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment