diff options
| author | polo <ordipolo@gmx.fr> | 2026-07-02 00:01:31 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-07-02 00:01:31 +0200 |
| commit | 0fa852ee4e9c3060ba7fc0daf4b08a44ea151f7f (patch) | |
| tree | aa41e7a0a2e41649dea66114e73a26574a042b85 /src/controller/ArticleController.php | |
| parent | 9021dc699874c46b72dcbe019ec1a4408fbf6d70 (diff) | |
| download | cms-0fa852ee4e9c3060ba7fc0daf4b08a44ea151f7f.tar.gz cms-0fa852ee4e9c3060ba7fc0daf4b08a44ea151f7f.tar.bz2 cms-0fa852ee4e9c3060ba7fc0daf4b08a44ea151f7f.zip | |
entité Presentation, MAJ filtre ViewController::SPECIAL_PAGES, table node_data non allégée pour l'instant
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 | ||
