tango-app-api-audit 3.5.30 → 3.5.31

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,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.5.30",
3
+ "version": "3.5.31",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1231,6 +1231,29 @@ export async function summaryList( req, res ) {
1231
1231
  store: 1,
1232
1232
  } },
1233
1233
  ];
1234
+ const getcount = await aggregateClusters( inputData.keyType === 'rm'?RMQuery: clusterQuery );
1235
+ const count = getcount?.length || 0;
1236
+ if ( count == 0 ) {
1237
+ return res.sendError( 'No data', 204 );
1238
+ }
1239
+ if ( inputData.isExport === false || !inputData.isExport ) {
1240
+ RMQuery.push(
1241
+ {
1242
+ $skip: offset,
1243
+ },
1244
+ {
1245
+ $limit: limit,
1246
+ },
1247
+ );
1248
+ clusterQuery.push(
1249
+ {
1250
+ $skip: offset,
1251
+ },
1252
+ {
1253
+ $limit: limit,
1254
+ },
1255
+ );
1256
+ }
1234
1257
  const getCluster = await aggregateClusters( inputData.keyType === 'rm'?RMQuery: clusterQuery );
1235
1258
  logger.info( { getCluster: getCluster } );
1236
1259
  if ( !getCluster || getCluster?.length == 0 ) {
@@ -1326,7 +1349,7 @@ export async function summaryList( req, res ) {
1326
1349
  await download( result, res );
1327
1350
  return;
1328
1351
  } else {
1329
- return res.sendSuccess( { result: temp, count: getCluster?.length || 0 } );
1352
+ return res.sendSuccess( { result: temp, count: count || 0 } );
1330
1353
  }
1331
1354
  } else {
1332
1355
  let search ={