tango-app-api-audit 3.5.21 → 3.5.22

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.21",
3
+ "version": "3.5.22",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1599,9 +1599,12 @@ export async function getUserConfig( req, res ) {
1599
1599
  configureType: 'user',
1600
1600
 
1601
1601
  };
1602
- const getOne = await findOneEyeTestConfig( query, { userList: 1 } );
1602
+ const getOne = await findOneEyeTestConfig( query, { userList: 1, _id: 1 } );
1603
+ if ( !getOne ) {
1604
+ return res.sendError( ' No data found', 204 );
1605
+ }
1603
1606
  logger.info( { getOne: getOne, message: 'getUserConfig' } );
1604
- return res.sendSuccess( { result: getOne?.userList || [] } );
1607
+ return res.sendSuccess( { result: getOne || [] } );
1605
1608
  } catch ( error ) {
1606
1609
  const err = error.message || 'Internal Server Error';
1607
1610
  logger.error( { message: error, data: req.body, function: 'eyetestAudit-controller-getUserConfig' } );
@@ -1736,12 +1739,15 @@ export async function getEmailConfig( req, res ) {
1736
1739
  clientId: clientId,
1737
1740
  configureType: 'email',
1738
1741
  };
1739
- const getOne = await findOneEyeTestConfig( query, { complianceThreshold: 1 } );
1742
+ const getOne = await findOneEyeTestConfig( query, { complianceThreshold: 1, _id: 1 } );
1740
1743
  logger.info( { getOne: getOne, message: 'getEmailConfig' } );
1741
1744
  // if ( !getOne?.complianceThreshold ) {
1742
1745
  // return res.sendError( 'No data found', 204 );
1743
1746
  // }
1744
- return res.sendSuccess( { result: getOne?.complianceThreshold } );
1747
+ if ( !getOne ) {
1748
+ return res.sendError( ' No data found', 204 );
1749
+ }
1750
+ return res.sendSuccess( { result: getOne } );
1745
1751
  } catch ( error ) {
1746
1752
  const err = error.message || 'Internal Server Error';
1747
1753
  logger.error( { message: error, data: req.body, function: 'eyetestAudit-controller-getEmailConfig' } );