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