tango-app-api-trax 3.7.12-qid-3 → 3.7.12-qid-4

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.7.12-qid-3",
3
+ "version": "3.7.12-qid-4",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -863,6 +863,17 @@ export const duplicateChecklist = async ( req, res ) => {
863
863
  sectionDetails.checkList = dupDetails.checkListName;
864
864
  sectionDetails.createdAt = new Date();
865
865
  sectionDetails.updatedAt = new Date();
866
+ for ( let j = 0; j < sectionDetails.question.length; j++ ) {
867
+ let questionArr = sectionDetails.question[j];
868
+ if ( questionArr && questionArr.uniqueqid && questionArr.uniqueqid != '' ) {
869
+ let spliteID = questionArr.uniqueqid.split( '-' );
870
+ questionArr.uniqueqid =
871
+ spliteID[0] + '-' +
872
+ dupDetails.checkListNumber + '-' +
873
+ spliteID[2] + '-' +
874
+ spliteID[3];
875
+ }
876
+ }
866
877
  delete sectionDetails['_id'];
867
878
  sections.push( sectionDetails );
868
879
  }
@@ -870,8 +881,10 @@ export const duplicateChecklist = async ( req, res ) => {
870
881
  let actionType = 'Duplicated';
871
882
  let teamsMsg;
872
883
  let teamsAlertUrls = process.env.teamsAlertURL ? JSON.parse( process.env.teamsAlertURL ) : '';
873
- teamsMsg = 'ClientId: '+ checkDetails.client_id + ', Action: '+ actionType + ', ChecklistId: '+ data._id + ', Checklist Name: '+ checkDetails.checkListName + ', UpDatedBy: '+ req.user.email;
874
- sendTeamsNotification( teamsAlertUrls.checklist, teamsMsg );
884
+ if ( teamsAlertUrls && teamsAlertUrls !='' ) {
885
+ teamsMsg = 'ClientId: '+ checkDetails.client_id + ', Action: '+ actionType + ', ChecklistId: '+ data._id + ', Checklist Name: '+ checkDetails.checkListName + ', UpDatedBy: '+ req.user.email;
886
+ sendTeamsNotification( teamsAlertUrls.checklist, teamsMsg );
887
+ }
875
888
 
876
889
  let logObj = {
877
890
  client_id: checkDetails.client_id,
@@ -1824,6 +1837,7 @@ export const updateConfigure =async ( req, res ) => {
1824
1837
 
1825
1838
  export const updateConfigurev1 =async ( req, res ) => {
1826
1839
  try {
1840
+ console.log( '123' );
1827
1841
  let inputBody = req.body;
1828
1842
  let id;
1829
1843
  let checklistDetails;
@@ -1845,7 +1859,7 @@ export const updateConfigurev1 =async ( req, res ) => {
1845
1859
  }
1846
1860
  }
1847
1861
 
1848
- if ( !inputBody.checkListDetails.assignedUsers.length && inputBody.submitType == 'publish' ) {
1862
+ if ( !inputBody?.checkListDetails?.assignedUsers?.length && inputBody.submitType == 'publish' ) {
1849
1863
  return res.sendError( 'Please Assigned a user', 400 );
1850
1864
  }
1851
1865