diff --git a/src/controllers/user_activity.ts b/src/controllers/user_activity.ts index 3d116e1..78d0a15 100644 --- a/src/controllers/user_activity.ts +++ b/src/controllers/user_activity.ts @@ -1,4 +1,5 @@ -import { Request, Response, NextFunction, Application } from "express"; +import { Response, NextFunction, Application } from "express"; +import { Request } from "express-jwt"; import { ReturnHelper } from "../helpers/express/return"; import { OrmHelper } from "../helpers/orm"; import { User } from "../entity/users"; @@ -72,11 +73,14 @@ export class UserActivityController { let whereVal: any = {}; if (param.filter) { - whereAttr = 'module like :filter_like or username like :filter_like or email = :filter '; + whereAttr = '(module like :filter_like or username like :filter_like or email = :filter) and '; whereVal['filter'] = param.filter whereVal['filter_like'] = '%' + param.filter + '%' } + whereAttr += 'id_user = :id_user' + whereVal['id_user'] = req.auth.data.id; + const res_count = userRepository.createQueryBuilder() .where(whereAttr, whereVal); const res_list = userRepository.createQueryBuilder()