From de01f32f34e11f4a9b0f6351f9c1f5373552aa48 Mon Sep 17 00:00:00 2001
From: RiFav <13521075@std.stei.itb.ac.id>
Date: Sun, 8 Oct 2023 04:34:23 +0700
Subject: [PATCH] feat: delete event backend handling

---
 app/Controllers/EventController.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/app/Controllers/EventController.php b/app/Controllers/EventController.php
index 921bdc6..5416fbe 100644
--- a/app/Controllers/EventController.php
+++ b/app/Controllers/EventController.php
@@ -112,6 +112,13 @@ class EventController {
                 header("Location:Views/home/home.php");
                 ob_end_flush();
             }
+            elseif ($_POST['eventAction'] === 'deleteEvent') {
+                unset($_POST['eventAction']);
+                $eventId = $_POST['eventId'];
+                $this->deleteEvent($eventId);
+                header("Location:Views/home/home.php");
+                ob_end_flush();
+            }
         } else {
             // Handle other actions here, if needed
         }
-- 
GitLab