add lastCommentsScope to blocking rest

This commit is contained in:
Umputun
2018-10-27 13:20:50 -05:00
parent c589b5d65c
commit 904bc11c09
+2 -2
View File
@@ -74,7 +74,7 @@ func (a *admin) deleteUserCtrl(w http.ResponseWriter, r *http.Request) {
rest.SendErrorJSON(w, r, http.StatusInternalServerError, err, "can't delete user")
return
}
a.cache.Flush(cache.Flusher(siteID).Scopes(userID, siteID))
a.cache.Flush(cache.Flusher(siteID).Scopes(userID, siteID, lastCommentsScope))
render.Status(r, http.StatusOK)
render.JSON(w, r, JSON{"user_id": userID, "site_id": siteID})
}
@@ -149,7 +149,7 @@ func (a *admin) setBlockCtrl(w http.ResponseWriter, r *http.Request) {
rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't set blocking status")
return
}
a.cache.Flush(cache.Flusher(siteID).Scopes(userID, siteID))
a.cache.Flush(cache.Flusher(siteID).Scopes(userID, siteID, lastCommentsScope))
render.JSON(w, r, JSON{"user_id": userID, "site_id": siteID, "block": blockStatus})
}