tango-app-api-trax 3.4.1-alpha-14 → 3.4.1-alpha-16

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.4.1-alpha-14",
3
+ "version": "3.4.1-alpha-16",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2492,6 +2492,10 @@ export const flagChecklistTableV1 = async ( req, res ) => {
2492
2492
  if ( resultData ) {
2493
2493
  if ( resultData.status_code == '200' ) {
2494
2494
  const exportdata = [];
2495
+ console.log( resultData );
2496
+ if ( reqestData.ChecklistType==='scrum'||reqestData.ChecklistType==='cleaning' ) {
2497
+ reqestData.ChecklistType = 'scrumdetection';
2498
+ }
2495
2499
  resultData[reqestData.ChecklistType + 'Data'].forEach( ( element ) => {
2496
2500
  exportdata.push( {
2497
2501
  'Date': element?.date,
@@ -3196,15 +3196,16 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
3196
3196
  delete ans.index;
3197
3197
  delete ans.validationAnswer;
3198
3198
  delete ans.answeroptionNumber;
3199
- ans.nestedQuestion = ans?.oldNestedQuestion ? ans.oldNestedQuestion : [];
3200
- ans.linkedQuestion = ans?.oldLinkedQuestion ? ans.oldLinkedQuestion : 0;
3199
+ ans.nestedQuestion = ans?.oldNestedQuestion ? ans.oldNestedQuestion : ans.nestedQuestion;
3200
+ ans.linkedQuestion = ans?.oldLinkedQuestion ? ans.oldLinkedQuestion : ans.linkedQuestion;
3201
3201
  delete ans.oldNestedQuestion;
3202
3202
  delete ans.oldLinkedQuestion;
3203
3203
  } );
3204
3204
  const compare = findDifferences( data, qns );
3205
3205
  if ( compare?.answerType || compare?.answers || compare?.linkType ) {
3206
3206
  logger.info( 'compare =>', compare );
3207
- logger.info( 'qno =>', data.qno );
3207
+ logger.info( 'compareSection =>', { section: section.sectionName } );
3208
+ logger.info( 'qno =>', { qno: data.qno } );
3208
3209
  modifiedCount++;
3209
3210
  question.push( { question: qns, type: 'qnEdit' } );
3210
3211
  } else {
@@ -3225,16 +3226,13 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
3225
3226
  sectionList.push( { sectionName: section?.sectionName, oldName: section?.sectionOldName, question: section.questions, type: 'add' } );
3226
3227
  }
3227
3228
  }
3228
- console.log( JSON.stringify( sectionList ) );
3229
3229
  // getsubmitDetails[0].questionAnswers = sectionList;
3230
3230
  sectionList.forEach( ( sec ) => {
3231
3231
  if ( sec.type == 'add' ) {
3232
3232
  getsubmitDetails[0].questionAnswers.push( sec );
3233
3233
  } else {
3234
3234
  sec.question.forEach( ( qn ) => {
3235
- console.log( qn, 'qn' );
3236
3235
  let sectionDetails = getsubmitDetails[0].questionAnswers.findIndex( ( section ) => section.sectionName == sec?.oldName || section.sectionName == sec.sectionName );
3237
- console.log( sectionDetails, 'detauls' );
3238
3236
  if ( qn.type == 'add' ) {
3239
3237
  getsubmitDetails[0].questionAnswers[sectionDetails].questions.push( qn.question );
3240
3238
  } else {
@@ -3244,14 +3242,13 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
3244
3242
  }
3245
3243
  return acc;
3246
3244
  }, [] );
3247
- console.log( questions, 'question' );
3248
3245
  if ( questions.length && [ 'qnEdit', 'nameChange' ].includes( qn.type ) ) {
3249
3246
  if ( qn.type == 'qnEdit' ) {
3250
3247
  let checkLinkType = getsubmitDetails[0].questionAnswers[sectionDetails].questions[questions[0]].linkType;
3251
3248
  if ( checkLinkType && !qn.question.linkType ) {
3252
3249
  questions.forEach( ( qnIdx, index ) => {
3253
3250
  if ( index != 0 ) {
3254
- getsubmitDetails[0].questionAnswers[sectionDetails].questions[questions[0]].splice( qnIdx, 1 );
3251
+ getsubmitDetails[0].questionAnswers[sectionDetails].questions.splice( qnIdx, 1 );
3255
3252
  }
3256
3253
  } );
3257
3254
  questions = [ questions[0] ];
@@ -3277,7 +3274,6 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
3277
3274
  getsubmitDetails[0].approvalStatus = false;
3278
3275
  }
3279
3276
  let data = { ...getsubmitDetails[0]._doc };
3280
- console.log( JSON.stringify( data ), 'data' );
3281
3277
  await processedchecklist.updateOne( { _id: getsubmitDetails[0]._id }, data );
3282
3278
  if ( editSubmit && getsubmitDetails[0].checklistStatus == 'submit' ) {
3283
3279
  let user = {