Changed the way relation is saved in relations API

pull/1641/head
Marek Takac 10 years ago committed by Alex Coles
parent df8e56a781
commit 3d6948662e
  1. 3
      lib/api/v3/relations/relations_api.rb

@ -19,10 +19,9 @@ module API
r.delay = declared_params[:delay_id]
end
if relation.valid?
if relation.valid? && relation.save
model = ::API::V3::WorkPackages::RelationModel.new(relation)
representer = ::API::V3::WorkPackages::RelationRepresenter.new(model, work_package: relation.to)
relation.save!
representer
else
fail Errors::Validation.new(relation)

Loading…
Cancel
Save