fix: Suspended users showing in group and collection member management (#1302)
* fix: Suspended users showing in group and collection member management * test
This commit is contained in:
@ -21,13 +21,22 @@ const { authorize } = policy;
|
||||
const router = new Router();
|
||||
|
||||
router.post('users.list', auth(), pagination(), async ctx => {
|
||||
const { query } = ctx.body;
|
||||
const { query, includeSuspended = false } = ctx.body;
|
||||
const user = ctx.state.user;
|
||||
|
||||
let where = {
|
||||
teamId: user.teamId,
|
||||
};
|
||||
|
||||
if (!includeSuspended) {
|
||||
where = {
|
||||
...where,
|
||||
suspendedAt: {
|
||||
[Op.eq]: null,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (query) {
|
||||
where = {
|
||||
...where,
|
||||
|
Reference in New Issue
Block a user