Commit 7e142480 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Use rescued 404 instead explicity not_found method call

parent 68e5f51b
...@@ -57,9 +57,7 @@ module API ...@@ -57,9 +57,7 @@ module API
requires :issue_link_id, type: Integer, desc: 'The ID of an issue link' requires :issue_link_id, type: Integer, desc: 'The ID of an issue link'
end end
delete ':id/issues/:issue_iid/links/:issue_link_id' do delete ':id/issues/:issue_iid/links/:issue_link_id' do
issue_link = IssueLink.find_by(id: declared_params[:issue_link_id]) issue_link = IssueLink.find(declared_params[:issue_link_id])
not_found! unless issue_link
result = ::IssueLinks::DestroyService result = ::IssueLinks::DestroyService
.new(issue_link, current_user) .new(issue_link, current_user)
......
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