This commit is contained in:
2025-07-07 14:39:42 +02:00
8 changed files with 147 additions and 10 deletions

View File

@@ -79,15 +79,15 @@ class NotesController
$_SESSION['user_id'],
$_POST['priority']
);
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.'
]);
}
}