tango-app-api-audit 3.5.31 → 3.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1648,7 +1648,7 @@ export async function summaryCard( req, res ) {
|
|
|
1648
1648
|
filter.push(
|
|
1649
1649
|
{
|
|
1650
1650
|
range: {
|
|
1651
|
-
|
|
1651
|
+
ComplianceScore: {
|
|
1652
1652
|
lt: inputData?.complianceScore, // 🔹 adjust threshold here (e.g. gte: 50 for >= 50%)
|
|
1653
1653
|
},
|
|
1654
1654
|
},
|
|
@@ -2101,7 +2101,17 @@ export async function rmList( req, res ) {
|
|
|
2101
2101
|
configureType: 'user',
|
|
2102
2102
|
};
|
|
2103
2103
|
const getRMList = await findOneEyeTestConfig( query, { userList: 1 } );
|
|
2104
|
-
|
|
2104
|
+
let temp = [];
|
|
2105
|
+
|
|
2106
|
+
if ( getRMList && getRMList?.userList ) {
|
|
2107
|
+
const emailList = getRMList.userList.map( ( item ) => item.email )||
|
|
2108
|
+
[];
|
|
2109
|
+
logger.info( { emailList: emailList } );
|
|
2110
|
+
temp = await findOneUser( { email: { $in: emailList }, role: 'admin', isActive: true }, { userName: 1, email: 1, _id: 1, role: 1 } );
|
|
2111
|
+
return res.sendSuccess( { result: temp } );
|
|
2112
|
+
} else {
|
|
2113
|
+
return res.sendSuccess( { result: temp } );
|
|
2114
|
+
}
|
|
2105
2115
|
} catch ( error ) {
|
|
2106
2116
|
const err = error.message || 'Internal Server Error';
|
|
2107
2117
|
logger.error( { message: error, data: req.body, function: 'eyetestAudit-controller-rmList' } );
|
|
@@ -7,3 +7,7 @@ export function updateOneEyeTestConfig( query, record, upsert ) {
|
|
|
7
7
|
export function findOneEyeTestConfig( query, field ) {
|
|
8
8
|
return eyeTestConfigurationModel.findOne( query, field );
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
export function findEyeTestConfig( query, field ) {
|
|
12
|
+
return eyeTestConfigurationModel.find( query, field );
|
|
13
|
+
}
|
|
@@ -5,6 +5,10 @@ export function findOneUser( query, fields ) {
|
|
|
5
5
|
return userModel.findOne( query, fields );
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
export function findUser( query, fields ) {
|
|
9
|
+
return userModel.find( query, fields );
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
export function aggregateUser( query ) {
|
|
9
13
|
return userModel.aggregate( query );
|
|
10
14
|
}
|