forked from forgejo/forgejo
[MODERATION] add user blocking API
- Follow up for: #540, #802
- Add API routes for user blocking from user and organization
perspective.
- The new routes have integration testing.
- The new model functions have unit tests.
- Actually quite boring to write and to read this pull request.
(cherry picked from commit f3afaf15c7
)
This commit is contained in:
parent
37b4e6ef9b
commit
6d754db3e5
12 changed files with 626 additions and 9 deletions
|
@ -6,6 +6,7 @@ package setting
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
|
@ -23,7 +24,7 @@ func BlockedUsers(ctx *context.Context) {
|
|||
ctx.Data["BaseLink"] = setting.AppSubURL + "/user/settings/blocked_users"
|
||||
ctx.Data["BaseLinkNew"] = setting.AppSubURL + "/user/settings/blocked_users"
|
||||
|
||||
blockedUsers, err := user_model.ListBlockedUsers(ctx, ctx.Doer.ID)
|
||||
blockedUsers, err := user_model.ListBlockedUsers(ctx, ctx.Doer.ID, db.ListOptions{})
|
||||
if err != nil {
|
||||
ctx.ServerError("ListBlockedUsers", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue