announcements: implement list feeds endpoint

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-06-12 06:10:29 -04:00
parent 14ec8472ef
commit d19471fd4d
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 9 additions and 0 deletions

View File

@ -73,6 +73,10 @@ class Announcements:
"/server/announcements/feed", ["POST", "DELETE"], "/server/announcements/feed", ["POST", "DELETE"],
self._handle_feed_request self._handle_feed_request
) )
self.server.register_endpoint(
"/server/announcements/feeds", ["GET"],
self._handle_list_feeds
)
self.server.register_notification( self.server.register_notification(
"announcements:dismissed", "announcement_dismissed" "announcements:dismissed", "announcement_dismissed"
) )
@ -164,6 +168,11 @@ class Announcements:
"modified": changed "modified": changed
} }
async def _handle_list_feeds(
self, web_request: WebRequest
) -> Dict[str, Any]:
return {"feeds": list(self.subscriptions.keys())}
async def _handle_feed_request( async def _handle_feed_request(
self, web_request: WebRequest self, web_request: WebRequest
) -> Dict[str, Any]: ) -> Dict[str, Any]: