Toggle showing read items

This commit is contained in:
2020-11-08 19:38:55 +00:00
parent 0a97bef247
commit 614264ebea
4 changed files with 37 additions and 4 deletions

View File

@@ -33,6 +33,10 @@ func (a *API) GetUnread(c *fiber.Ctx) error {
return c.JSON(a.FeedStore.GetUnread())
}
func (a *API) GetAll(c *fiber.Ctx) error {
return c.JSON(a.FeedStore.GetAll())
}
func (a *API) PostRead(c *fiber.Ctx) error {
a.FeedStore.MarkAsRead(c.Params("id"))
return nil

View File

@@ -52,6 +52,7 @@ func Start(port string) error {
app.Get("/api/feed/:id", api.GetFeed)
app.Get("/api/item/:id", api.GetItem)
app.Get("/api/unread", api.GetUnread)
app.Get("/api/all", api.GetAll)
app.Post("/api/read/:id", api.PostRead)
app.Post("/api/read", api.PostReadAll)
app.Get("/api/refresh", api.RefreshAll)