|
|
|
@ -55,17 +55,17 @@ module API |
|
|
|
|
# After Pass 1 the correct type information is merged into the WP |
|
|
|
|
# In Pass 2 the representer is created with the new type info and will be able |
|
|
|
|
# to also parse custom fields successfully |
|
|
|
|
merge_json_into_work_package!(request_body.to_json) |
|
|
|
|
merge_json_into_work_package!(request_body.to_json) |
|
|
|
|
merge_hash_into_work_package!(request_body) |
|
|
|
|
merge_hash_into_work_package!(request_body) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# merges the given JSON representation into @work_package |
|
|
|
|
def merge_json_into_work_package!(json) |
|
|
|
|
def merge_hash_into_work_package!(hash) |
|
|
|
|
payload = Form::WorkPackagePayloadRepresenter.create( |
|
|
|
|
@work_package, |
|
|
|
|
enforce_lock_version_validation: true) |
|
|
|
|
payload.from_json(json) |
|
|
|
|
payload.from_hash(hash) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def request_body |
|
|
|
|