tango-app-api-audit 3.4.16 → 3.4.18

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.4.16",
3
+ "version": "3.4.18",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  "mongodb": "^6.7.0",
25
25
  "nodemon": "^3.1.3",
26
26
  "swagger-ui-express": "^5.0.1",
27
- "tango-api-schema": "^2.1.42",
27
+ "tango-api-schema": "^2.1.53",
28
28
  "tango-app-api-middleware": "^3.1.33",
29
29
  "winston": "^3.13.0",
30
30
  "winston-daily-rotate-file": "^5.0.0"
@@ -1721,9 +1721,8 @@ export async function userAuditHistory( req, res ) {
1721
1721
  return exportData;
1722
1722
  } );
1723
1723
  const mappedArrays = await Promise.all( promises );
1724
- mappedArrays.flat();
1725
- logger.info( { mappedArrays: mappedArrays[0] } );
1726
- await download( mappedArrays[0], res );
1724
+ const result = mappedArrays.flat();
1725
+ await download( result, res );
1727
1726
  return;
1728
1727
  } else {
1729
1728
  query.push( {
@@ -1905,9 +1905,8 @@ export async function userAuditHistory( req, res ) {
1905
1905
  return exportData;
1906
1906
  } );
1907
1907
  const mappedArrays = await Promise.all( promises );
1908
- mappedArrays.flat();
1909
- logger.info( { mappedArrays: mappedArrays[0] } );
1910
- await download( mappedArrays[0], res );
1908
+ const response = mappedArrays.flat();
1909
+ await download( response, res );
1911
1910
  return;
1912
1911
  } else {
1913
1912
  query.push( {
@@ -4584,9 +4583,9 @@ export async function save( req, res ) {
4584
4583
  clientName: getClient?.clientName,
4585
4584
  storeId: inputData.storeId,
4586
4585
  storeName: getStore?.storeName,
4587
- spocName: getStore?.spocDetails[0]?.name,
4588
- spocEmail: getStore?.spocDetails[0]?.email,
4589
- spocContact: getStore?.spocDetails[0].contact,
4586
+ spocName: getStore?.spocDetails? getStore?.spocDetails[0]?.name : '',
4587
+ spocEmail: getStore?.spocDetails? getStore?.spocDetails[0]?.email:'',
4588
+ spocContact: getStore?.spocDetails? getStore?.spocDetails[0].contact:'',
4590
4589
  address: getStore?.storeProfile?.address,
4591
4590
  fileDate: inputData.fileDate,
4592
4591
  moduleType: inputData.moduleType,
@@ -4627,7 +4626,7 @@ export async function save( req, res ) {
4627
4626
  const err = error.message || 'Internal Server Error';
4628
4627
  logger.error( {
4629
4628
  error: error,
4630
- message: req.query,
4629
+ message: req.body,
4631
4630
  function: 'saveTrax',
4632
4631
  } );
4633
4632
  return res.sendError( err, 500 );
@@ -11,7 +11,7 @@ export async function validateUserEmpDetection( req, res, next ) {
11
11
  _id: inputData.auditId,
12
12
  } );
13
13
  if ( !userAuditDetails ) {
14
- return res.sendError( 'No Data Available' );
14
+ return res.sendError( 'No Data Available', 204 );
15
15
  } else if ( userAuditDetails && userAuditDetails.auditStatus == 'skipped' ) {
16
16
  return res.sendError( 'The Audit file Assigned to some one else', 203 );
17
17
  }
@@ -21,7 +21,7 @@ export async function validateUserEmpDetection( req, res, next ) {
21
21
  const err = error.message || 'Internal Server Error';
22
22
  logger.error( {
23
23
  error: error,
24
- message: req.query,
24
+ message: req.body,
25
25
  function: 'validateUserEmpDetection',
26
26
  } );
27
27
  return res.sendError( err, 500 );