added upload to createNotes

This commit is contained in:
Felix Ivo
2025-07-07 10:21:15 +02:00
parent 871ffe01d0
commit 48f1fb8923
4 changed files with 86 additions and 7 deletions

View File

@@ -77,15 +77,15 @@ class NotesController
$_POST['content'],
$_SESSION['user_id']
);
if ($note) {
// Redirect to show notes page after successful creation
// Redirect to show notes page after successful update
header('Location: ?controller=Notes&page=showNotes&do=showNotes');
exit();
} else {
// If creation failed, show error message and stay on the form
// If update failed, show error message and stay on the form
$this->view->setVars([
'error' => 'Failed to create note. Please try again.'
'error' => 'Failed to update note. Please try again.'
]);
}
}