ObjectController: reasonable defaults for REST PUT

This commit is contained in:
Thomas Gelf 2016-02-23 09:09:10 +01:00
parent 037b3178a0
commit 2d826ba939
1 changed files with 7 additions and 0 deletions

View File

@ -252,6 +252,13 @@ abstract class ObjectController extends ActionController
if ($request->getMethod() === 'POST') {
$object->setProperties($data);
} else {
$data = array_merge(
array(
'object_type' => $object->object_type,
'object_name' => $object->object_name
),
$data
);
$object->replaceWith(
IcingaObject::createByType($type, $data, $db)
);