diff --git a/src/controllers/user_activity.ts b/src/controllers/user_activity.ts index 6c8495f..f0e4d11 100644 --- a/src/controllers/user_activity.ts +++ b/src/controllers/user_activity.ts @@ -78,8 +78,6 @@ export class UserActivityController { token: Joi.string().required().label('Token'), }); - - const param: PagingActivity = await schema.validateAsync(req.query); const userRepository = OrmHelper.DB.getRepository(UserActivity); diff --git a/src/helpers/common.ts b/src/helpers/common.ts index a0e3d0d..b36a8a0 100644 --- a/src/helpers/common.ts +++ b/src/helpers/common.ts @@ -192,15 +192,7 @@ export default class CommonHelper { } } - const whereAttr = whereAttrPre.join(' and ') + (whereAttrPre.length > 0 && param.additional_where != '' ? ' and ' : '') + (param.additional_where ?? ''); - - // let whereAttr = ''; - // if (whereAttrPre.length > 0) { - // whereAttr = whereAttrPre.join(' and ') + (whereAttrPre.length > 0 && param.additional_where != '' ? ' and ' : '') + (param.additional_where ?? ''); - // } else { - // whereAttr += param.additional_where; - // } - + const whereAttr = whereAttrPre.join(' and ') + (whereAttrPre.length > 0 && param.additional_where && param.additional_where != '' ? ' and ' : '') + (param.additional_where ?? ''); return { whereAttr, whereVal }; }