|
@@ -74,6 +74,17 @@ class ArticleApiController extends ControllerAdapter {
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
function getDoArticles(?string $categoryName = null): void {
|
|
function getDoArticles(?string $categoryName = null): void {
|
|
|
|
|
+ if ($categoryName == null) {
|
|
|
|
|
+ $articlesToShow = $this->articleDao->getArticles();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $articlesToShow = $this->articleDao->getArticlesByCategoryName($categoryName);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ echo $categoryName;
|
|
|
|
|
+
|
|
|
|
|
+ $this->sendJson($articlesToShow);
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
$articles = $this->articleDao->getArticles();
|
|
$articles = $this->articleDao->getArticles();
|
|
|
$articlesToShow = [];
|
|
$articlesToShow = [];
|
|
|
if ($categoryName !== null) {
|
|
if ($categoryName !== null) {
|
|
@@ -87,6 +98,7 @@ class ArticleApiController extends ControllerAdapter {
|
|
|
$articlesToShow = $articles;
|
|
$articlesToShow = $articles;
|
|
|
}
|
|
}
|
|
|
$this->sendJson($articlesToShow);
|
|
$this->sendJson($articlesToShow);
|
|
|
|
|
+ */
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|