api: Use JsonResponse in form

refs #9606
This commit is contained in:
Eric Lippmann 2015-09-07 13:36:12 +02:00
parent 25abc16e15
commit f467d085b0
1 changed files with 4 additions and 5 deletions

View File

@ -1117,11 +1117,10 @@ class Form extends Zend_Form
// API targets and API requests will never redirect but immediately respond w/ JSON-encoded // API targets and API requests will never redirect but immediately respond w/ JSON-encoded
// notifications // notifications
$messages = Notification::getInstance()->popMessages(); $messages = Notification::getInstance()->popMessages();
// @TODO(el): Use ApiResponse class for unified response handling. // @TODO(el): Remove the type from the message
$this->getResponse()->sendJson(array( $this->getResponse()->json()
'status' => 'success', ->setSuccessData(array('message' => array_pop($messages)))
'message' => array_pop($messages) // @TODO(el): Remove the type from the message ->sendResponse();
));
} elseif (! $frameUpload) { } elseif (! $frameUpload) {
$this->getResponse()->redirectAndExit($this->getRedirectUrl()); $this->getResponse()->redirectAndExit($this->getRedirectUrl());
} else { } else {