added upload to createNotes

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

No files matched your search

+4 -4
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.'
]);
}
}