Jelajahi Sumber

original code uncommented

internship 3 tahun lalu
induk
melakukan
7c43737c61
1 mengubah file dengan 9 tambahan dan 9 penghapusan
  1. 9 9
      src-php/app/internship/controller/ArticleController.php

+ 9 - 9
src-php/app/internship/controller/ArticleController.php

@@ -45,17 +45,17 @@ class ArticleController extends ControllerAdapter {
 	 * @throws PageNotFoundException if Article could not be found.
 	 */
 	function getDoArticle(int $articleId): void {
-//        $out = array($articleId=>$this->articleDao->getArticleById($articleId));
-//        if (in_array(null, $out, true)) {
-//            throw new PageNotFoundException();
-//        }
-//        $this->sendJson($out);
-
-        $article = $this->articleDao->getArticleById($articleId);
-        if ($article === null) {
+        $out = array($articleId=>$this->articleDao->getArticleById($articleId));
+        if (in_array(null, $out, true)) {
             throw new PageNotFoundException();
         }
-        $this->sendJson($article);
+        $this->sendJson($out);
+
+//        $article = $this->articleDao->getArticleById($articleId);
+//        if ($article === null) {
+//            throw new PageNotFoundException();
+//        }
+//        $this->sendJson($article);
 	}
 
 	/**