aboutsummaryrefslogtreecommitdiff
path: root/api/category.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/category.go')
-rw-r--r--api/category.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/api/category.go b/api/category.go
index 9a351581..64cc036b 100644
--- a/api/category.go
+++ b/api/category.go
@@ -123,3 +123,20 @@ func (h *handler) removeCategory(w http.ResponseWriter, r *http.Request) {
json.NoContent(w, r)
}
+
+func (h *handler) refreshCategory(w http.ResponseWriter, r *http.Request) {
+ userID := request.UserID(r)
+ categoryID := request.RouteInt64Param(r, "categoryID")
+
+ jobs, err := h.store.NewCategoryBatch(userID, categoryID, h.store.CountFeeds(userID))
+ if err != nil {
+ json.ServerError(w, r, err)
+ return
+ }
+
+ go func() {
+ h.pool.Push(jobs)
+ }()
+
+ json.NoContent(w, r)
+}