tango-app-api-trax 3.2.0-beta.2 → 3.2.0-beta.3

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.2.0-beta.2",
3
+ "version": "3.2.0-beta.3",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -453,10 +453,10 @@ export async function sopMobilechecklistQuestionValidator( req, res, next ) {
453
453
  return res.sendError( 'Check List Got Edited Please Fill Again', 422 );
454
454
  }
455
455
 
456
- if ( getChecklistQA ) {
456
+ if ( getChecklistQA && requestData.submittype == 'submit' ) {
457
457
  let checkChecklistStatus = await checklistService.findOne( { _id: getChecklistQA.sourceCheckList_id }, { publish: 1 } );
458
458
  if ( !checkChecklistStatus.publish ) {
459
- return res.sendError( 'Check List Got Edited Please Fill Again', 422 );
459
+ return res.sendError( 'Checklist got edited.please contact admin', 400 );
460
460
  }
461
461
  }
462
462
 
@@ -2434,6 +2434,15 @@ export async function uploadAnswerImage( req, res ) {
2434
2434
  return res.sensError( 'Invalid Request: Please include questionNo!', 400 );
2435
2435
  }
2436
2436
 
2437
+ let getChecklistQA = await processedchecklist.findOne( { _id: input.checklistId }, { sourceCheckList_id: 1 } );
2438
+
2439
+ if ( getChecklistQA ) {
2440
+ let checkChecklistStatus = await checklistService.findOne( { _id: getChecklistQA.sourceCheckList_id }, { publish: 1 } );
2441
+ if ( !checkChecklistStatus.publish ) {
2442
+ return res.sendError( 'Checklist got edited.please contact admin', 400 );
2443
+ }
2444
+ }
2445
+
2437
2446
  let date = dayjs().format( 'YYYY-MM-DD' );
2438
2447
  let folder;
2439
2448