* [FIX] Wrong behavior when returning controller's method result

* [MOD] Code refactoring
This commit is contained in:
nuxsmin
2018-08-22 20:22:50 +02:00
parent 3c78910569
commit b2687c58a6
40 changed files with 653 additions and 653 deletions

View File

@@ -44,33 +44,37 @@ final class AccountFavoriteController extends SimpleControllerBase
/**
* @param $accountId
*
* @return bool
*/
public function markAction($accountId)
{
try {
$this->accountFavoriteService->add($accountId, $this->session->getUserData()->getId());
$this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Favorito añadido'));
return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Favorito añadido'));
} catch (\Exception $e) {
processException($e);
$this->returnJsonResponseException($e);
return $this->returnJsonResponseException($e);
}
}
/**
* @param $accountId
*
* @return bool
*/
public function unmarkAction($accountId)
{
try {
$this->accountFavoriteService->delete($accountId, $this->session->getUserData()->getId());
$this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Favorito eliminado'));
return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Favorito eliminado'));
} catch (\Exception $e) {
processException($e);
$this->returnJsonResponseException($e);
return $this->returnJsonResponseException($e);
}
}