added upload to createNotes
This commit is contained in:
@@ -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.'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user