mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add ProblemSelectAutoComplete
This commit is contained in:
1 parent
1c89596cb3
commit
90443546c8
7 files changed
+80
-3
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { Collection } from 'mongodb';
|
||||
import { escapeRegExp } from 'lodash';
|
||||
import * as system from './system';
|
||||
import token from './token';
|
||||
import * as setting from './setting';
|
||||
@@ -224,7 +225,7 @@ class UserModel {
|
||||
@ArgMethod
|
||||
static async getPrefixList(domainId: string, prefix: string, limit: number = 50) {
|
||||
prefix = prefix.toLowerCase();
|
||||
const $regex = new RegExp(`\\A\\Q${prefix}\\E`, 'gmi');
|
||||
const $regex = new RegExp(`\\A${escapeRegExp(prefix)}`, 'gmi');
|
||||
const uids = await coll.find({ unameLower: { $regex } })
|
||||
.limit(limit).map((doc) => doc._id).toArray();
|
||||
const users = [];
|
||||
|
||||
Reference in new issue
Block a user