refactor Utils package
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import express from 'express';
|
||||
import svgCaptcha from 'svg-captcha';
|
||||
import Utils from '../../app/Utils.js';
|
||||
|
||||
const collection = 'users';
|
||||
|
||||
@@ -138,7 +139,7 @@ class UsersController {
|
||||
limit: req.body.limit || 12, skip: req.body.skip || 0
|
||||
};
|
||||
if (req.body.email) {
|
||||
q.query.email = { $regex: global.JsUtils.escapeRegExp(req.body.email), $options: 'i' }
|
||||
q.query.email = { $regex: Utils.escapeRegExp(req.body.email), $options: 'i' }
|
||||
}
|
||||
let list = await db.list(collection, q);
|
||||
res.json(list);
|
||||
|
||||
Reference in New Issue
Block a user