update function common filter

This commit is contained in:
2024-12-02 21:12:48 +07:00
parent 536638bf35
commit a17b91b1f5
2 changed files with 1 additions and 11 deletions

View File

@ -78,8 +78,6 @@ export class UserActivityController {
token: Joi.string().required().label('Token'), token: Joi.string().required().label('Token'),
}); });
const param: PagingActivity = await schema.validateAsync(req.query); const param: PagingActivity = await schema.validateAsync(req.query);
const userRepository = OrmHelper.DB.getRepository(UserActivity); const userRepository = OrmHelper.DB.getRepository(UserActivity);

View File

@ -192,15 +192,7 @@ export default class CommonHelper {
} }
} }
const whereAttr = whereAttrPre.join(' and ') + (whereAttrPre.length > 0 && param.additional_where != '' ? ' and ' : '') + (param.additional_where ?? ''); const whereAttr = whereAttrPre.join(' and ') + (whereAttrPre.length > 0 && param.additional_where && 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;
// }
return { whereAttr, whereVal }; return { whereAttr, whereVal };
} }