Commit a1125248 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Return all persisted issues regardless of success or failure on creation

parent bd87c15d
......@@ -11,11 +11,7 @@ module Projects
opts = params.slice(:issue_references)
result = IssueLinks::CreateService.new(issue, current_user, opts).execute
if result[:status] == :success
render json: { result: result, issues: issues }, status: result[:http_status]
else
render json: { result: result }, status: result[:http_status]
end
render json: { result: result, issues: issues }, status: result[:http_status]
end
def destroy
......
......@@ -82,7 +82,8 @@ describe Projects::IssueLinksController, type: :controller do
it 'returns failure JSON' do
is_expected.to have_http_status(401)
expect(json_response).to eq('result' => { 'http_status' => 401, 'status' => 'error' })
expect(json_response).to eq('result' => { 'http_status' => 401, 'status' => 'error' },
'issues' => list_service_response)
end
end
end
......
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