tango-app-api-audit 3.5.57 → 3.5.59

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.57",
3
+ "version": "3.5.59",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -363,7 +363,6 @@ export async function getAuditFile( req, res ) {
363
363
  temp.functionName='audit-controller-getAuditFile';
364
364
  temp.messageType = 'log';
365
365
  temp.message ='Hit in drafted file';
366
- msg = JSON.parse( consumer );
367
366
  temp.storeId =userDetails[0].storeId;
368
367
  temp.fileDate =userDetails[0].fileDate;
369
368
  temp.totalCount =userDetails[0].beforeCount;
@@ -864,18 +863,18 @@ export async function getAuditFile( req, res ) {
864
863
  } catch ( error ) {
865
864
  /* openSearch logs start*/
866
865
  const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Error_${req?.user?.userEmail}_${Date.now()}`;
867
- let temp = inputData;
866
+ let temp = req.query;
868
867
  temp.logType='audit';
869
868
  temp.logSubType='get-audit-file';
870
869
  temp.functionName='audit-controller-getAuditFile';
871
870
  temp.messageType = 'error';
872
871
  temp.message =error.message || 'Internal Server Error';
873
- temp.storeId =msg?.store_id;
874
- temp.fileDate =msg?.curr_date;
875
- temp.totalCount =msg?.total_count;
876
- temp.zoneName =msg?.zone_id;
877
- temp.auditType = msg?.audit_type;
878
- temp.indexName= msg?.index_name;
872
+ // temp.storeId =msg?.store_id;
873
+ // temp.fileDate =msg?.curr_date;
874
+ // temp.totalCount =msg?.total_count;
875
+ // temp.zoneName =msg?.zone_id;
876
+ // temp.auditType = msg?.audit_type;
877
+ // temp.indexName= msg?.index_name;
879
878
  await openSearchLog( temp, req.user, id );
880
879
  /* openSearch logs end*/
881
880
  logger.error( {
@@ -443,15 +443,16 @@ export async function openSearchLog( inputData, user, id ) {
443
443
  auditType: inputData.auditType || '',
444
444
  folderPath: inputData.folderPath || '',
445
445
  params: inputData.params||'',
446
- createdAt: new Date(),
447
- updatedAt: new Date(),
446
+
448
447
  },
448
+ createdAt: new Date(),
449
+ updatedAt: new Date(),
449
450
 
450
451
  };
451
452
  await insertWithId( openSearch.auditedLogs, id, logs );
452
453
  return true;
453
454
  } catch ( error ) {
454
- logger.error( { error: error, message: { logs: logs, id: id }, function: 'openSearchLog-audit.validation' } );
455
+ logger.error( { error: error, message: { logs: inputData, id: id }, function: 'openSearchLog-audit.validation' } );
455
456
  return false;
456
457
  }
457
458
  }