mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 17:43:08 +02:00
Resolve #4501
This commit is contained in:
parent
5a87763193
commit
dfabdef60f
2 changed files with 5 additions and 2 deletions
|
@ -20,6 +20,7 @@ User.createIndex('createdAt');
|
|||
User.createIndex('updatedAt');
|
||||
User.createIndex('followersCount');
|
||||
User.createIndex('tags');
|
||||
User.createIndex('isSuspended');
|
||||
User.createIndex('username');
|
||||
User.createIndex('usernameLower');
|
||||
User.createIndex('host');
|
||||
|
|
|
@ -70,7 +70,8 @@ export default define(meta, async (ps, me) => {
|
|||
users = await User
|
||||
.find({
|
||||
host: null,
|
||||
usernameLower: new RegExp('^' + escapeRegexp(ps.query.replace('@', '').toLowerCase()))
|
||||
usernameLower: new RegExp('^' + escapeRegexp(ps.query.replace('@', '').toLowerCase())),
|
||||
isSuspended: false
|
||||
}, {
|
||||
limit: ps.limit,
|
||||
skip: ps.offset
|
||||
|
@ -80,7 +81,8 @@ export default define(meta, async (ps, me) => {
|
|||
const otherUsers = await User
|
||||
.find({
|
||||
host: { $ne: null },
|
||||
usernameLower: new RegExp('^' + escapeRegexp(ps.query.replace('@', '').toLowerCase()))
|
||||
usernameLower: new RegExp('^' + escapeRegexp(ps.query.replace('@', '').toLowerCase())),
|
||||
isSuspended: false
|
||||
}, {
|
||||
limit: ps.limit - users.length
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue