summaryrefslogtreecommitdiff
path: root/public/delete/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/delete/index.php')
-rw-r--r--public/delete/index.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/public/delete/index.php b/public/delete/index.php
index e07129a..9864c9a 100644
--- a/public/delete/index.php
+++ b/public/delete/index.php
@@ -3,6 +3,7 @@
declare(strict_types=1);
use DTS\BookmarkRepository;
+use DTS\Session;
use function DTS\Functions\respondAndExit;
use function DTS\Functions\redirectAndExit;
@@ -10,6 +11,8 @@ require_once(__DIR__.'/../../autoload.php');
$config = require_once(__DIR__.'/../../config.php');
+$session = Session::getInstance();
+
if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') !== 'POST') {
respondAndExit(405, 'Method Not Allowed');
}
@@ -28,4 +31,6 @@ if (!$bookmarks->delete($bookmark)) {
respondAndExit(500, 'Internal Server Error');
}
+$session->set('message', 'Bookmark Deleted');
+
redirectAndExit('/');