tango-app-api-trax 3.9.5 → 3.9.7
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
|
@@ -545,8 +545,8 @@ export async function redoChecklist( req, res ) {
|
|
|
545
545
|
redoStatus: true,
|
|
546
546
|
...( !checklistConfigDetails?.redoValidity && { reinitiateStatus: true } ),
|
|
547
547
|
questionAnswers: question,
|
|
548
|
-
...( checklistDetails.checklistStatus
|
|
549
|
-
...(
|
|
548
|
+
...( checklistDetails.checklistStatus == 'inprogress' && checklistDetails.redoStatus ) ? { redoEdit: true } : {},
|
|
549
|
+
...( !checklistDetails.redoStatus && checklistConfigDetails.redoValidity ) ? { scheduleEndTime_iso: dayjs( checklistDetails.scheduleEndTime_iso ).add( checklistConfigDetails.redoValidity, 'day' ).format() } :{},
|
|
550
550
|
};
|
|
551
551
|
|
|
552
552
|
let response = await processedChecklist.updateOne( { _id: req.body.payload._id }, updateData );
|
|
@@ -660,7 +660,7 @@ export async function sopMobilechecklistQuestionValidatorv1( req, res, next ) {
|
|
|
660
660
|
requestSection.forEach( ( item ) => item.section_id = section.section_id );
|
|
661
661
|
section.questions.forEach( ( question ) => {
|
|
662
662
|
// question.answers.forEach( ( answer ) => {
|
|
663
|
-
let sectionQuestion = requestSection.filter( ( secQuestion ) => secQuestion.qname == question.oldQname || secQuestion.qname == question.qname );
|
|
663
|
+
let sectionQuestion = requestSection.filter( ( secQuestion ) => ( secQuestion.qname == question.oldQname || secQuestion.qname == question.qname ) && ( secQuestion.answerType == question.answerType ) );
|
|
664
664
|
if ( sectionQuestion.length ) {
|
|
665
665
|
if ( requestData.submittype == 'submit' ) {
|
|
666
666
|
if ( ( [ 'multipleImage', 'multiplechoicemultiple', 'image/video' ].includes( question.answerType ) || ( question.answerType =='dropdown' && question.allowMultiple ) ) ) {
|
|
@@ -3316,7 +3316,7 @@ async function updateOpenSearch( user, data ) {
|
|
|
3316
3316
|
$and: [
|
|
3317
3317
|
{ _id: new ObjectId( data.processedcheckListId ) },
|
|
3318
3318
|
{ userId: user._id },
|
|
3319
|
-
{ date_string: data.date },
|
|
3319
|
+
{ $or: [ { date_string: data.date }, { redoStatus: true } ] },
|
|
3320
3320
|
],
|
|
3321
3321
|
},
|
|
3322
3322
|
} ];
|