rename Blocked to better named BlockedUsers
This commit is contained in:
@@ -32,7 +32,7 @@ type adminStore interface {
|
||||
User(siteID, userID string, limit, skip int, user store.User) ([]store.Comment, error)
|
||||
IsBlocked(siteID string, userID string) bool
|
||||
SetBlock(siteID string, userID string, status bool, ttl time.Duration) error
|
||||
Blocked(siteID string) ([]store.BlockedUser, error)
|
||||
BlockedUsers(siteID string) ([]store.BlockedUser, error)
|
||||
Info(locator store.Locator, readonlyAge int) (store.PostInfo, error)
|
||||
SetTitle(locator store.Locator, commentID string) (comment store.Comment, err error)
|
||||
SetVerified(siteID string, userID string, status bool) error
|
||||
@@ -158,7 +158,7 @@ func (a *admin) setBlockCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
// GET /blocked?site=siteID - list blocked users
|
||||
func (a *admin) blockedUsersCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
siteID := r.URL.Query().Get("site")
|
||||
users, err := a.dataService.Blocked(siteID)
|
||||
users, err := a.dataService.BlockedUsers(siteID)
|
||||
if err != nil {
|
||||
rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't get blocked users", rest.ErrSiteNotFound)
|
||||
return
|
||||
|
||||
@@ -536,8 +536,8 @@ func (s *DataStore) SetBlock(siteID string, userID string, status bool, ttl time
|
||||
return err
|
||||
}
|
||||
|
||||
// Blocked returns list with all blocked users
|
||||
func (s *DataStore) Blocked(siteID string) (res []store.BlockedUser, err error) {
|
||||
// BlockedUsers returns list with all blocked users for given siteID
|
||||
func (s *DataStore) BlockedUsers(siteID string) (res []store.BlockedUser, err error) {
|
||||
blocked, e := s.Engine.ListFlags(engine.FlagRequest{Locator: store.Locator{SiteID: siteID}, Flag: engine.Blocked})
|
||||
if e != nil {
|
||||
return nil, errors.Wrapf(err, "can't get list of blocked users for %s", siteID)
|
||||
@@ -606,7 +606,7 @@ func (s *DataStore) Metas(siteID string) (umetas []UserMetaData, pmetas []PostMe
|
||||
m := map[string]UserMetaData{}
|
||||
|
||||
// process blocked users
|
||||
blocked, err := s.Blocked(siteID)
|
||||
blocked, err := s.BlockedUsers(siteID)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrapf(err, "can't get list of blocked users for %s", siteID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user