tango-app-api-audit 3.5.35 → 3.5.37
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getOpenSearchData, getOpenSearchById, logger, insertOpenSearchData, updateOpenSearchData, download, chunkArray, getOpenSearchCount, insertWithId } from 'tango-app-api-middleware';
|
|
2
|
-
import { findOneUser } from '../service/user.service.js';
|
|
2
|
+
import { findOneUser, findUser } from '../service/user.service.js';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import utc from 'dayjs/plugin/utc.js';
|
|
@@ -2100,23 +2100,15 @@ export async function clusterList( req, res ) {
|
|
|
2100
2100
|
],
|
|
2101
2101
|
},
|
|
2102
2102
|
},
|
|
2103
|
-
{
|
|
2104
|
-
$group: {
|
|
2105
|
-
_id: null,
|
|
2106
|
-
clientId: { $first: '$clientId' },
|
|
2107
|
-
clusterList: { $addToSet: '$clusterName' },
|
|
2108
|
-
},
|
|
2109
|
-
},
|
|
2110
2103
|
{
|
|
2111
2104
|
$project: {
|
|
2112
|
-
_id:
|
|
2105
|
+
_id: 1,
|
|
2113
2106
|
clientId: 1,
|
|
2114
|
-
|
|
2107
|
+
clusterName: 1,
|
|
2115
2108
|
},
|
|
2116
2109
|
},
|
|
2117
2110
|
];
|
|
2118
2111
|
const getClusterList = await aggregateClusters( query );
|
|
2119
|
-
logger.info( { getClusterList: getClusterList, query: query } );
|
|
2120
2112
|
return res.sendSuccess( { result: getClusterList || [] } );
|
|
2121
2113
|
} catch ( error ) {
|
|
2122
2114
|
const err = error.message || 'Internal Server Error';
|
|
@@ -2139,7 +2131,7 @@ export async function rmList( req, res ) {
|
|
|
2139
2131
|
const emailList = getRMList.userList.map( ( item ) => item.email )||
|
|
2140
2132
|
[];
|
|
2141
2133
|
logger.info( { emailList: emailList } );
|
|
2142
|
-
temp = await
|
|
2134
|
+
temp = await findUser( { email: { $in: emailList }, role: 'admin', isActive: true }, { userName: 1, email: 1, _id: 1, role: 1 } );
|
|
2143
2135
|
return res.sendSuccess( { result: temp } );
|
|
2144
2136
|
} else {
|
|
2145
2137
|
return res.sendSuccess( { result: temp } );
|