ObjectController: REST API 422 was too strict

This commit is contained in:
Thomas Gelf 2016-03-12 01:36:58 +01:00
parent f971839f82
commit 23b1b008a8

View File

@ -267,11 +267,13 @@ abstract class ObjectController extends ActionController
$this->db()
);
} elseif ($this->getRequest()->isApiRequest()) {
$this->getResponse()->setHttpResponseCode(422);
if ($this->getRequest()->isGet()) {
$this->getResponse()->setHttpResponseCode(422);
throw new InvalidPropertyException(
'Cannot load object, missing parameters'
);
throw new InvalidPropertyException(
'Cannot load object, missing parameters'
);
}
}
$this->view->undeployedChanges = $this->countUndeployedChanges();