updateArticle

This commit is contained in:
2026-06-01 09:11:11 +02:00
parent 2cd68873de
commit 2a3e73d409
3 changed files with 35 additions and 16 deletions
+6 -1
View File
@@ -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";
}