summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-03-21 20:14:26 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-03-21 20:14:26 +0900
commit346036ec88fae983d249fbd9367fb7d2b28404a5 (patch)
tree06c10094f7197e30113343600f0df0fe8f6901a8 /src/server
parentNew Crowdin translations (#6062) (diff)
downloadsharkey-346036ec88fae983d249fbd9367fb7d2b28404a5.tar.gz
sharkey-346036ec88fae983d249fbd9367fb7d2b28404a5.tar.bz2
sharkey-346036ec88fae983d249fbd9367fb7d2b28404a5.zip
Fix #6110
updatedAt が null なユーザーは検索に出てこなくなる副作用あり
Diffstat (limited to 'src/server')
-rw-r--r--src/server/api/endpoints/users/search-by-username-and-host.ts3
-rw-r--r--src/server/api/endpoints/users/search.ts2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/server/api/endpoints/users/search-by-username-and-host.ts b/src/server/api/endpoints/users/search-by-username-and-host.ts
index bc68f44094..b6ba09d0c0 100644
--- a/src/server/api/endpoints/users/search-by-username-and-host.ts
+++ b/src/server/api/endpoints/users/search-by-username-and-host.ts
@@ -72,6 +72,7 @@ export default define(meta, async (ps, me) => {
q.andWhere('user.usernameLower like :username', { username: ps.username.toLowerCase() + '%' })
}
+ q.andWhere('user.updatedAt IS NOT NULL');
q.orderBy('user.updatedAt', 'DESC');
const users = await q.take(ps.limit!).skip(ps.offset).getMany();
@@ -82,6 +83,7 @@ export default define(meta, async (ps, me) => {
.where('user.host IS NULL')
.andWhere('user.isSuspended = FALSE')
.andWhere('user.usernameLower like :username', { username: ps.username.toLowerCase() + '%' })
+ .andWhere('user.updatedAt IS NOT NULL')
.orderBy('user.updatedAt', 'DESC')
.take(ps.limit!)
.skip(ps.offset)
@@ -92,6 +94,7 @@ export default define(meta, async (ps, me) => {
.where('user.host IS NOT NULL')
.andWhere('user.isSuspended = FALSE')
.andWhere('user.usernameLower like :username', { username: ps.username.toLowerCase() + '%' })
+ .andWhere('user.updatedAt IS NOT NULL')
.orderBy('user.updatedAt', 'DESC')
.take(ps.limit! - users.length)
.getMany();
diff --git a/src/server/api/endpoints/users/search.ts b/src/server/api/endpoints/users/search.ts
index c01f355d8c..7733b1a6bf 100644
--- a/src/server/api/endpoints/users/search.ts
+++ b/src/server/api/endpoints/users/search.ts
@@ -74,6 +74,7 @@ export default define(meta, async (ps, me) => {
.where('user.host IS NULL')
.andWhere('user.isSuspended = FALSE')
.andWhere('user.usernameLower like :username', { username: ps.query.replace('@', '').toLowerCase() + '%' })
+ .andWhere('user.updatedAt IS NOT NULL')
.orderBy('user.updatedAt', 'DESC')
.take(ps.limit!)
.skip(ps.offset)
@@ -84,6 +85,7 @@ export default define(meta, async (ps, me) => {
.where('user.host IS NOT NULL')
.andWhere('user.isSuspended = FALSE')
.andWhere('user.usernameLower like :username', { username: ps.query.replace('@', '').toLowerCase() + '%' })
+ .andWhere('user.updatedAt IS NOT NULL')
.orderBy('user.updatedAt', 'DESC')
.take(ps.limit! - users.length)
.getMany();