From 1de9cb6447e57cae23cb2505b552322f99146ff2 Mon Sep 17 00:00:00 2001 From: Gregorio Chiko Putra Date: Fri, 8 Sep 2017 16:30:16 +0700 Subject: [PATCH] Changed actions order. --- App/Controllers/Posts.php | 7 ++++--- Core/Model.php | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index 58dd7d3..b690764 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -108,10 +108,11 @@ class Posts 'user' => $user, 'token' => Token::generate() ]); + + $this->table = 'pengumuman'; } else { throw new \Exception("Page not found", 404); } - $this->table = 'pengumuman'; } public function edit($id) @@ -174,11 +175,11 @@ class Posts 'categories' => $categories, 'token' => Token::generate() ]); + + $this->table = 'pengumuman'; } else { throw new \Exception("Bad request", 400); } - - $this->table = 'pengumuman'; } /* Methods */ diff --git a/Core/Model.php b/Core/Model.php index 132d877..72b9f85 100644 --- a/Core/Model.php +++ b/Core/Model.php @@ -174,7 +174,6 @@ abstract class Model return true; } catch (PDOException $e) { throw new \Exception($e->getMessage(), 444); - } } }