updateArticle
This commit is contained in:
@@ -23,7 +23,12 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
|
||||
try {
|
||||
$articleManager = ArticleManager::getInstance(); // TODO: Später aus Session den Nutzer auslesen und Autorenrechte prüfen!
|
||||
$articleManager->updateArticle(new Article($newTitle, $newContent, $newCategory, $author, $newTags), $author);
|
||||
$article = $articleManager->getArticle($id);
|
||||
$article->setTitle($newTitle);
|
||||
$article->setContent($newContent);
|
||||
$article->setCategory($newCategory);
|
||||
$article->setTags($newTags);
|
||||
$articleManager->updateArticle($id ,$article, $author);
|
||||
} catch (Exception $e){
|
||||
$_SESSION["message"] = "internal_error";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user