fixed delete note

This commit is contained in:
Felix Ivo
2025-06-27 10:54:24 +02:00
parent 5a63cc66c5
commit 95b7634901
3 changed files with 12 additions and 57 deletions

View File

@@ -88,8 +88,12 @@ class NotesController
public function deleteNote()
{
$noteId = $_GET['id'];
$this->notesModel->deleteNote($noteId, $_SESSION['user_id']);
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['note_id'])) {
$noteId = $_POST['note_id'];
$this->notesModel->deleteNote($noteId, $_SESSION['user_id']);
}
header("Location: ?controller=Notes&page=showNotes&do=showNotes");
exit();
}
}