tango-app-api-trax 3.4.1-alpha-1 → 3.4.1-alpha-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
|
@@ -1027,7 +1027,8 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
|
|
|
1027
1027
|
try {
|
|
1028
1028
|
let requestData = req.body;
|
|
1029
1029
|
requestData.questionAnswers = typeof requestData.questionAnswers == 'string' ? JSON.parse( requestData.questionAnswers ) : requestData.questionAnswers;
|
|
1030
|
-
let
|
|
1030
|
+
let getDetails = await processedchecklist.findOne( { _id: new ObjectId( requestData.processedcheckListId ) }, { checkListId: 1 } );
|
|
1031
|
+
let getChecklistQA = await PCLconfig.findOne( { _id: getDetails.checkListId }, { questionAnswers: 1 } );
|
|
1031
1032
|
let reqAnswers = requestData.questionAnswers;
|
|
1032
1033
|
logger.error( { functionName: 'updatedPayload', message: reqAnswers } );
|
|
1033
1034
|
let CLQAnswers = getChecklistQA.questionAnswers;
|
|
@@ -1349,7 +1350,7 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
|
|
|
1349
1350
|
let des = [];
|
|
1350
1351
|
if ( requestSection[i].answer != 'null' && requestSection[i].answer != '' && requestSection[i].answer != null ) {
|
|
1351
1352
|
let validationAnswer = '';
|
|
1352
|
-
if ( requestSection[i].answer.
|
|
1353
|
+
if ( requestSection[i].answer.includes( 'https' ) ) {
|
|
1353
1354
|
validationAnswer = decodeURIComponent( requestSection[i].answer.split( '?' )[0] );
|
|
1354
1355
|
}
|
|
1355
1356
|
if ( validationAnswer.length ) {
|
|
@@ -247,7 +247,7 @@ export const create = async ( req, res ) => {
|
|
|
247
247
|
section.questions[qIdx].answers[index].nestedQuestion = [];
|
|
248
248
|
}
|
|
249
249
|
if ( answer.showLinked ) {
|
|
250
|
-
section.questions[qIdx].answers[nestedIndex].nestedQuestion.push( answer.linkedQuestion );
|
|
250
|
+
// section.questions[qIdx].answers[nestedIndex].nestedQuestion.push( answer.linkedQuestion );
|
|
251
251
|
if ( nestedIndex != -1 ) {
|
|
252
252
|
// if ( !section.questions[qIdx].answers[nestedIndex].nestedQuestion.includes( answer.linkedQuestion ) ) {
|
|
253
253
|
section.questions[qIdx].answers[nestedIndex].nestedQuestion.push( answer.linkedQuestion );
|
|
@@ -287,6 +287,7 @@ export const create = async ( req, res ) => {
|
|
|
287
287
|
return res.sendSuccess( { checklistId: checkListId, msg: 'CheckList Created Successfully' } );
|
|
288
288
|
}
|
|
289
289
|
} ).catch( ( e ) => {
|
|
290
|
+
console.log( e );
|
|
290
291
|
return res.sendError( e, 500 );
|
|
291
292
|
} );
|
|
292
293
|
}
|
|
@@ -296,6 +297,7 @@ export const create = async ( req, res ) => {
|
|
|
296
297
|
}
|
|
297
298
|
}
|
|
298
299
|
} ).catch( async ( e ) => {
|
|
300
|
+
console.log( e );
|
|
299
301
|
await checklistService.deleteOne( { _id: checkListId } );
|
|
300
302
|
return res.sendError( e, 500 );
|
|
301
303
|
} );
|