tango-app-api-audit 1.0.61 → 1.0.63

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": "1.0.61",
3
+ "version": "1.0.63",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1294,7 +1294,7 @@ export async function save( req, res ) {
1294
1294
  // // moduleType: inputData.moduleType,
1295
1295
  // // zoneName: inputData.zoneName,
1296
1296
  // } );
1297
- const isoDate = userAudit?.startTime;
1297
+ const isoDate = req.body.userAudit?.startTime;
1298
1298
  const currentTime = dayjs();
1299
1299
  const isoDateTime = dayjs( isoDate );
1300
1300
  const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
@@ -1319,7 +1319,7 @@ export async function save( req, res ) {
1319
1319
 
1320
1320
  let storeConfig = await findOneStore(
1321
1321
  {
1322
- storeId: userAudit?.storeId,
1322
+ storeId: req.body.userAudit?.storeId,
1323
1323
  },
1324
1324
  {
1325
1325
  auditConfigs: 1,
@@ -1418,7 +1418,7 @@ export async function save( req, res ) {
1418
1418
  } catch ( error ) {
1419
1419
  const err = error.message || 'Internal Server Error';
1420
1420
  logger.error( { error: error, message: req.body, function: 'save' } );
1421
- return res.sendError( err );
1421
+ return res.sendError( err, 500 );
1422
1422
  }
1423
1423
  }
1424
1424