summaryrefslogtreecommitdiff
path: root/internal/api/client/notification/notification.go
diff options
context:
space:
mode:
authorLibravatar Artémis <diane@artemix.org>2022-08-01 11:13:49 +0200
committerLibravatar GitHub <noreply@github.com>2022-08-01 11:13:49 +0200
commit4fdbef04b4ae41e6193d4f4416c83edf91e1bfb7 (patch)
treef28b7d40c38ee6b83ae5ff386cf25dc55ed0e157 /internal/api/client/notification/notification.go
parentserve HEAD requests via the fileserver (#735) (diff)
downloadgotosocial-4fdbef04b4ae41e6193d4f4416c83edf91e1bfb7.tar.xz
[feature] Implemented notification clear (#720)
* Implemented notification clear * Added the cache clear mechanism * added multi user check test
Diffstat (limited to 'internal/api/client/notification/notification.go')
-rw-r--r--internal/api/client/notification/notification.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/api/client/notification/notification.go b/internal/api/client/notification/notification.go
index e5c527696..61a84f60a 100644
--- a/internal/api/client/notification/notification.go
+++ b/internal/api/client/notification/notification.go
@@ -33,7 +33,8 @@ const (
BasePath = "/api/v1/notifications"
// BasePathWithID is just the base path with the ID key in it.
// Use this anywhere you need to know the ID of the notification being queried.
- BasePathWithID = BasePath + "/:" + IDKey
+ BasePathWithID = BasePath + "/:" + IDKey
+ BasePathWithClear = BasePath + "/clear"
// MaxIDKey is the url query for setting a max notification ID to return
MaxIDKey = "max_id"
@@ -58,5 +59,6 @@ func New(processor processing.Processor) api.ClientModule {
// Route attaches all routes from this module to the given router
func (m *Module) Route(r router.Router) error {
r.AttachHandler(http.MethodGet, BasePath, m.NotificationsGETHandler)
+ r.AttachHandler(http.MethodPost, BasePathWithClear, m.NotificationsClearPOSTHandler)
return nil
}