diff options
Diffstat (limited to 'src/controller/ArticleController.php')
| -rw-r--r-- | src/controller/ArticleController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/controller/ArticleController.php b/src/controller/ArticleController.php index 7019f5c..0ddb0e1 100644 --- a/src/controller/ArticleController.php +++ b/src/controller/ArticleController.php | |||
| @@ -5,6 +5,7 @@ declare(strict_types=1); | |||
| 5 | 5 | ||
| 6 | use App\Entity\Node; | 6 | use App\Entity\Node; |
| 7 | use App\Entity\Article; | 7 | use App\Entity\Article; |
| 8 | use App\Entity\Presentation; | ||
| 8 | use Doctrine\ORM\EntityManager; | 9 | use Doctrine\ORM\EntityManager; |
| 9 | use Symfony\Component\HttpFoundation\Request; | 10 | use Symfony\Component\HttpFoundation\Request; |
| 10 | use Symfony\Component\HttpFoundation\Response; | 11 | use Symfony\Component\HttpFoundation\Response; |
| @@ -21,7 +22,7 @@ class ArticleController | |||
| 21 | $model->findNodeById($id); | 22 | $model->findNodeById($id); |
| 22 | $parent_block = $model->getNode(); | 23 | $parent_block = $model->getNode(); |
| 23 | 24 | ||
| 24 | if(Blocks::hasPresentation($parent_block->getName())){ | 25 | if(Presentation::hasPresentation($parent_block->getName())){ |
| 25 | $get_articles_return = $model->getNextArticles($parent_block, $request); | 26 | $get_articles_return = $model->getNextArticles($parent_block, $request); |
| 26 | $bulk_data = $get_articles_return[0]; | 27 | $bulk_data = $get_articles_return[0]; |
| 27 | 28 | ||
| @@ -44,11 +45,11 @@ class ArticleController | |||
| 44 | return new JsonResponse(['success' => true, 'html' => $html, 'truncated' => $get_articles_return[1]]); | 45 | return new JsonResponse(['success' => true, 'html' => $html, 'truncated' => $get_articles_return[1]]); |
| 45 | } | 46 | } |
| 46 | else{ | 47 | else{ |
| 47 | return new JsonResponse(['success' => false, 'error' => 'server side error']); | 48 | return new JsonResponse(['success' => false, 'error' => 'server side error'], JsonResponse::HTTP_INTERNAL_SERVER_ERROR); |
| 48 | } | 49 | } |
| 49 | } | 50 | } |
| 50 | else{ | 51 | else{ |
| 51 | return new JsonResponse(['success' => false, 'error' => 'bad parameters']); | 52 | return new JsonResponse(['success' => false, 'error' => 'bad parameters'], JsonResponse::HTTP_BAD_REQUEST); |
| 52 | } | 53 | } |
| 53 | } | 54 | } |
| 54 | 55 | ||
