tango-app-api-trax 3.9.7 → 3.9.8

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.7",
3
+ "version": "3.9.8",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1084,12 +1084,15 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1084
1084
  try {
1085
1085
  let requestData = req.body;
1086
1086
  requestData.questionAnswers = typeof requestData.questionAnswers == 'string' ? JSON.parse( requestData.questionAnswers ) : requestData.questionAnswers;
1087
- let getChecklistQA = await processedchecklist.findOne( { _id: new ObjectId( requestData.processedcheckListId ) }, { questionAnswers: 1 } );
1087
+ let getChecklistQA = await processedchecklist.findOne( { _id: new ObjectId( requestData.processedcheckListId ) }, { questionAnswers: 1, redoEdit: 1 } );
1088
1088
  let reqAnswers = requestData.questionAnswers;
1089
1089
  logger.error( { functionName: 'updatedPayload', message: reqAnswers } );
1090
1090
  let CLQAnswers = getChecklistQA.questionAnswers;
1091
1091
 
1092
1092
  if ( requestData.submittype == 'submit' ) {
1093
+ if ( getChecklistQA?.redoEdit ) {
1094
+ requestData.submittype = 'draft';
1095
+ }
1093
1096
  reqAnswers.forEach( ( reqA ) => {
1094
1097
  if ( ![ 'multiplechoicemultiple', 'multipleImage', 'image/video' ].includes( reqA?.answerType ) && ( reqA.answerType == 'dropDown' && !reqA.allowMultiple ) ) {
1095
1098
  if ( ( !reqA.linkType && ( reqA.answer == null || reqA.answer == '' ) ) || ( reqA.linkType && reqA.linkquestionenabled && ( reqA.answer == null || reqA.answer == '' ) ) ) {