missed scopes for admin and import

This commit is contained in:
Umputun
2018-05-25 14:20:42 -05:00
parent 838c1a760f
commit 2c4c1998cd
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -50,7 +50,7 @@ func (a *admin) deleteCommentCtrl(w http.ResponseWriter, r *http.Request) {
rest.SendErrorJSON(w, r, http.StatusInternalServerError, err, "can't delete comment")
return
}
a.cache.Flush()
a.cache.Flush(locator.SiteID, locator.URL)
render.Status(r, http.StatusOK)
render.JSON(w, r, JSON{"id": id, "locator": locator})
}
@@ -65,7 +65,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()
a.cache.Flush(siteID, userID)
render.JSON(w, r, JSON{"user_id": userID, "site_id": siteID, "block": blockStatus})
}
@@ -91,7 +91,7 @@ func (a *admin) setPinCtrl(w http.ResponseWriter, r *http.Request) {
rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't set pin status")
return
}
a.cache.Flush()
a.cache.Flush(locator.URL)
render.JSON(w, r, JSON{"id": commentID, "locator": locator, "pin": pinStatus})
}
+1 -1
View File
@@ -93,7 +93,7 @@ func (s *Import) importCtrl(w http.ResponseWriter, r *http.Request) {
rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "import failed")
return
}
s.Cache.Flush()
s.Cache.Flush(siteID)
render.Status(r, http.StatusCreated)
render.JSON(w, r, JSON{"status": "ok", "size": size})