Skip to content
Snippets Groups Projects
Commit 230ecb05 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

dev #73651 : fix RT

parent b77622b1
Branches
Tags
4 merge requests!2660Master,!2586Master,!2585Hotline,!2575Dev#73651 api account
Pipeline #3802 passed with stage
in 33 minutes and 59 seconds
......@@ -23,12 +23,9 @@ class Api_ErrorController extends Zend_Controller_Action {
public function errorAction() {
$errors = $this->_getParam('error_handler');
$this->_response->setHttpResponseCode($errors->exception->getCode());
$this->_response->clearBody();
$this->_helper->json(['error' => 'invalid_request',
'message' => $errors->exception->getMessage()]);
$this->view->message = $errors->exception->getMessage();
return $this->renderScript('invalid_request.pjson');
$this->_response->setHttpResponseCode($errors->exception->getCode());
}
}
?>
\ No newline at end of file
......@@ -28,7 +28,12 @@ class Api_UserController extends ZendAfi_Controller_Action {
public function accountAction() {
$this->view->user = Class_Users::getIdentity();
$user = Class_Users::getIdentity();
$this->_helper
->json(['account' => ['label' => $user->getNomAff(),
'card' => ['id'=> $user->getIdabon(),
'expire_at' => $user->getDateFin()]
]]);
}
......@@ -66,4 +71,3 @@ class Api_UserController extends ZendAfi_Controller_Action {
throw new Zend_Controller_Action_Exception($message, $code);
}
}
?>
\ No newline at end of file
{
"error":"invalid_request",
"message":"<?php echo $this->message ?>"
}
\ No newline at end of file
<?php
echo json_encode(
['account' => ['label' => $this->user->getNomAff(),
'card' => [
'id'=> $this->user->getIdabon(),
'expire_at' => $this->user->getDateFin()
]
]
]
);
?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment