Tweak RemoveLog helper
Leave responding up to the endpoint Remove unnecessary parameter from the helper's parameter
This commit is contained in:
parent
cc03c5458a
commit
477c8b9212
|
@ -67,7 +67,7 @@ class Travis::Api::App
|
||||||
end
|
end
|
||||||
|
|
||||||
patch '/:id/log', scope: :private do |id|
|
patch '/:id/log', scope: :private do |id|
|
||||||
patch_log_for_job(id, params)
|
respond_with patch_log_for_job(params)
|
||||||
end
|
end
|
||||||
|
|
||||||
get "/:job_id/annotations" do
|
get "/:job_id/annotations" do
|
||||||
|
|
|
@ -12,8 +12,8 @@ class Travis::Api::App
|
||||||
|
|
||||||
# Clears up the content of the log by the *job id*
|
# Clears up the content of the log by the *job id*
|
||||||
# Optionally takes parameter *reason*
|
# Optionally takes parameter *reason*
|
||||||
patch '/:id' do |id|
|
patch '/:id' do
|
||||||
patch_log_for_job(id, params)
|
respond_with patch_log_for_job(params)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,9 +5,8 @@ class Travis::Api::App
|
||||||
module Helpers
|
module Helpers
|
||||||
Backports.require_relative_dir 'helpers'
|
Backports.require_relative_dir 'helpers'
|
||||||
|
|
||||||
def patch_log_for_job(id, params)
|
def patch_log_for_job(params)
|
||||||
result = self.service(:remove_log, params)
|
self.service(:remove_log, params).run
|
||||||
respond_with result
|
|
||||||
rescue Travis::AuthorizationDenied => ade
|
rescue Travis::AuthorizationDenied => ade
|
||||||
status 401
|
status 401
|
||||||
{ error: { message: ade.message } }
|
{ error: { message: ade.message } }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user