Toggle showing read items
This commit is contained in:
@@ -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
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user