Tweak RemoveLog helper

Leave responding up to the endpoint
Remove unnecessary parameter from the helper's parameter
This commit is contained in:
Hiro Asari 2014-06-11 20:19:57 -04:00
parent cc03c5458a
commit 477c8b9212
3 changed files with 5 additions and 6 deletions

View File

@ -67,7 +67,7 @@ class Travis::Api::App
end
patch '/:id/log', scope: :private do |id|
patch_log_for_job(id, params)
respond_with patch_log_for_job(params)
end
get "/:job_id/annotations" do

View File

@ -12,8 +12,8 @@ class Travis::Api::App
# Clears up the content of the log by the *job id*
# Optionally takes parameter *reason*
patch '/:id' do |id|
patch_log_for_job(id, params)
patch '/:id' do
respond_with patch_log_for_job(params)
end
end
end

View File

@ -5,9 +5,8 @@ class Travis::Api::App
module Helpers
Backports.require_relative_dir 'helpers'
def patch_log_for_job(id, params)
result = self.service(:remove_log, params)
respond_with result
def patch_log_for_job(params)
self.service(:remove_log, params).run
rescue Travis::AuthorizationDenied => ade
status 401
{ error: { message: ade.message } }