diff --git a/agent/config/routes b/agent/config/routes index a82b46809..467ccc691 100644 --- a/agent/config/routes +++ b/agent/config/routes @@ -50,7 +50,7 @@ /v0/wifi WifiR GET POST /v0/wifi/#Text WifiBySsidR POST DELETE -/v0/notifications NotificationsR GET +/v0/notifications NotificationsR GET DELETE /v0/notifications/#UUID NotificationR DELETE /v0/shutdown ShutdownR POST diff --git a/agent/src/Handler/Notifications.hs b/agent/src/Handler/Notifications.hs index 9d99a1076..9500b3c42 100644 --- a/agent/src/Handler/Notifications.hs +++ b/agent/src/Handler/Notifications.hs @@ -28,5 +28,9 @@ getNotificationsR = runDB $ do Nothing -> pure a Just x -> pure x +deleteNotificationsR :: Handler () +deleteNotificationsR = do + runDB $ deleteWhere ([] :: [Filter Notification]) + deleteNotificationR :: UUID -> Handler () deleteNotificationR notifId = runDB $ delete (coerce @_ @(Key Notification) notifId)