tango-app-api-trax 3.9.4 → 3.9.6

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-trax",
3
- "version": "3.9.4",
3
+ "version": "3.9.6",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -545,7 +545,7 @@ export async function redoChecklist( req, res ) {
545
545
  redoStatus: true,
546
546
  ...( !checklistConfigDetails?.redoValidity && { reinitiateStatus: true } ),
547
547
  questionAnswers: question,
548
- ...( checklistDetails.checklistStatus != 'submit' && checklistDetails.redoStatus ) ? { redoEdit: true } : {},
548
+ ...( checklistDetails.checklistStatus == 'inprogress' && checklistDetails.redoStatus ) ? { redoEdit: true } : {},
549
549
  ...( ( checklistDetails.redoEdit === undefined && checklistConfigDetails.redoValidity ) ) ? { scheduleEndTime_iso: dayjs( checklistDetails.scheduleEndTime_iso ).add( checklistConfigDetails.redoValidity, 'day' ).format() } :{},
550
550
  };
551
551
 
@@ -2686,7 +2686,7 @@ export async function submitChecklist( req, res ) {
2686
2686
  $and: [
2687
2687
  { _id: new ObjectId( requestData.processedcheckListId ) },
2688
2688
  { userId: req.user._id },
2689
- { date_string: requestData.date },
2689
+ { $or: [ { date_string: requestData.date }, { redoStatus: true } ] },
2690
2690
  ],
2691
2691
  },
2692
2692
  } );
@@ -2706,7 +2706,9 @@ export async function submitChecklist( req, res ) {
2706
2706
  let updateQuery = {};
2707
2707
  updateQuery._id = new ObjectId( requestData.processedcheckListId );
2708
2708
  updateQuery.userId = req.user._id;
2709
- updateQuery.date_string = requestData.date;
2709
+ if ( !getchecklist?.[0]?.redoStatus ) {
2710
+ updateQuery.date_string = requestData.date;
2711
+ }
2710
2712
 
2711
2713
  let currentDateTime;
2712
2714
  let storeTimeZone;
@@ -3314,7 +3316,7 @@ async function updateOpenSearch( user, data ) {
3314
3316
  $and: [
3315
3317
  { _id: new ObjectId( data.processedcheckListId ) },
3316
3318
  { userId: user._id },
3317
- { date_string: data.date },
3319
+ { $or: [ { date_string: data.date }, { redoStatus: true } ] },
3318
3320
  ],
3319
3321
  },
3320
3322
  } ];