tango-app-api-trax 3.8.19-nike → 3.8.20-nike

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.8.19-nike",
3
+ "version": "3.8.20-nike",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -668,7 +668,7 @@ export async function sopMobilechecklistQuestionValidatorv1( req, res, next ) {
668
668
  validationCount++;
669
669
  }
670
670
  } else {
671
- if ( ( ![ 'multiplechoicemultiple', 'multipleImage' ].includes( question.answerType ) && ( question.answerType =='dropdown' && !question.allowMultiple ) ) && ( ( !sectionQuestion[0].linkType && ( sectionQuestion[0].answer == null || sectionQuestion[0].answer == '' ) ) || ( sectionQuestion[0].linkType && sectionQuestion[0].linkquestionenabled && ( sectionQuestion[0].answer == null || sectionQuestion[0].answer == '' ) ) ) ) {
671
+ if ( ( !sectionQuestion[0].linkType && ( sectionQuestion[0].answer == null || sectionQuestion[0].answer == '' ) ) || ( sectionQuestion[0].linkType && sectionQuestion[0].linkquestionenabled && ( sectionQuestion[0].answer == null || sectionQuestion[0].answer == '' ) ) ) {
672
672
  validationCount++;
673
673
  }
674
674
  }
@@ -1589,6 +1589,18 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1589
1589
 
1590
1590
  requestData.questionAnswers = sectionFormat;
1591
1591
  logger.error( { message: requestData.questionAnswers, error: 'QuestionanswersPayload' } );
1592
+
1593
+ if ( requestData.submittype == 'submit' ) {
1594
+ for ( let section of sectionFormat ) {
1595
+ for ( let question of section.questions ) {
1596
+ let mustValidate = !question.linkType || ( question.linkType && question.linkquestionenabled );
1597
+ if ( mustValidate && ( !question.userAnswer || !question.userAnswer.length ) ) {
1598
+ return res.sendError( 'Please Fill All Fields', 400 );
1599
+ }
1600
+ }
1601
+ }
1602
+ }
1603
+
1592
1604
  next();
1593
1605
  } catch ( error ) {
1594
1606
  logger.error( { function: 'sopMobilechecklistMultiSectionFormatter', error: error, body: req.body } );