Agent/feature/delete all notifications (#317)

* updates to GHC 8.10.4

* adds delete all notifications handler
This commit is contained in:
Keagan McClelland
2021-05-05 10:01:16 -06:00
committed by Aiden McClelland
parent 8bb6530e24
commit 00636131d7
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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)