tango-app-api-audit 3.4.68-beta.14 → 3.4.68-beta.15

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.68-beta.14",
3
+ "version": "3.4.68-beta.15",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -197,7 +197,6 @@ export async function getList( req, res ) {
197
197
  'Engagement ID': element?._source?.engagementId,
198
198
  'Compliance Score': element?._source?.complianceScore || 0,
199
199
  'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
200
- 'Visitor Type': element?._source?.visitorsType,
201
200
  'Test Duration': duration || '',
202
201
  'Audit Status': element?._source?.auditStatus || '',
203
202
  'Audited By': userName?.userName || '',
@@ -483,7 +482,7 @@ export async function getFile( req, res ) {
483
482
 
484
483
  };
485
484
  await insertOpenSearchData( openSearch.EyeTestOutput, newRecord );
486
- await updateOpenSearchData( openSearch.EyeTestInput, inputData.id, { doc: { auditStatus: 'In-Progress', auditType: 'Re-Audit' } } );
485
+ await updateOpenSearchData( openSearch.EyeTestInput, inputData.id, { doc: { auditStatus: 'In-Progress', auditType: 'Re-Audit', userId: req?.user?._id } } );
487
486
 
488
487
  break;
489
488
  default:
@@ -561,7 +560,7 @@ export async function save( req, res ) {
561
560
  logger.info( { getOutput: getOutput } );
562
561
  const output = getOutput?.body?.hits?.hits?.length > 0 ? getOutput?.body?.hits?.hits[0] : null;
563
562
  if ( !output ) {
564
- return res.sendError( 'No saved records found', 400 );
563
+ return res.sendError( 'This file is currently being audited by another user. Any actions you perform will not be saved.', 400 );
565
564
  }
566
565
  const record ={
567
566
  steps: inputData?.steps,
@@ -773,7 +772,6 @@ export async function getFileHistory( req, res ) {
773
772
  let sourcesArray = resposnse.body.hits.hits.map( ( hit ) => hit );
774
773
  let outputData=[];
775
774
  for ( let data of sourcesArray ) {
776
- // console.log( data._source.endTime );
777
775
  let findUser= await findOneUser( { _id: new mongoose.Types.ObjectId( data._source.userId ) } );
778
776
  outputData.push( {
779
777
  _id: data._id,