tango-app-api-infra 3.8.1-beta.26 → 3.8.1-beta.28

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-infra",
3
- "version": "3.8.1-beta.26",
3
+ "version": "3.8.1-beta.28",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1601,9 +1601,20 @@ export async function allCounts( req, res ) {
1601
1601
  },
1602
1602
  },
1603
1603
  };
1604
+
1605
+ let response = result?.length > 0? result : [
1606
+ {
1607
+ 'installationCount': 0,
1608
+ 'infraCount': 0,
1609
+ 'datamismatchCount': 0,
1610
+ 'matCount': 0,
1611
+ 'footfallDirectory': 0,
1612
+ },
1613
+ ];
1614
+
1604
1615
  const geteDataCount = await getOpenSearchCount( openSearch.footfallDirectory, getCount );
1605
- result[0].footfallDirectory = geteDataCount?.body?.count || 0;
1606
- res.sendSuccess( result );
1616
+ response[0].footfallDirectory = geteDataCount?.body?.count || 0;
1617
+ return res.sendSuccess( response );
1607
1618
  } catch ( error ) {
1608
1619
  logger.error( { error: error, function: 'allCounts' } );
1609
1620
  return res.sendError( error, 500 );