tango-app-api-task 3.3.1-beta-7 → 3.3.1-beta-9

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-task",
3
- "version": "3.3.1-beta-7",
3
+ "version": "3.3.1-beta-9",
4
4
  "description": "Task",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -126,7 +126,7 @@ async function insertData( requestData ) {
126
126
  }
127
127
  }
128
128
 
129
- console.log( resultchecklist );
129
+ // console.log( resultchecklist );
130
130
 
131
131
 
132
132
  if ( resultchecklist.length ) {
@@ -141,7 +141,7 @@ async function insertData( requestData ) {
141
141
  let startTimeIso; let endTimeIso;
142
142
  startTimeIso = dayjs.utc( `${currentdate} ${sTime}`, 'YYYY-MM-DD hh:mm A' );
143
143
  endTimeIso = dayjs.utc( getCLconfig.scheduleEndTimeISO );
144
- console.log( endTimeIso );
144
+ // console.log( endTimeIso );
145
145
 
146
146
  let insertdata = {};
147
147
  insertdata.date_iso = new Date( dayjs( currentdate, 'YYYY-MM-DD' ).format( 'YYYY-MM-DD' ) );
@@ -269,7 +269,7 @@ async function insertData( requestData ) {
269
269
  if ( userIdList.length ) {
270
270
  allQuestion = allQuestion.filter( ( item ) => typeof item._id == 'undefined' );
271
271
  }
272
- console.log( allQuestion );
272
+ // console.log( allQuestion );
273
273
 
274
274
  if ( allQuestion ) {
275
275
  let assigndeletequery = {};
@@ -963,7 +963,7 @@ export async function taskConfig( req, res ) {
963
963
  return res.sendSuccess( { id: inputBody._id, message: message } );
964
964
  }
965
965
  } catch ( e ) {
966
- console.log( 'e', e );
966
+ // console.log( 'e', e );
967
967
  logger.error( { functionName: 'taskConfig =>', error: e, message: req.body } );
968
968
  return res.sendError( e, 500 );
969
969
  }
@@ -1357,7 +1357,7 @@ export async function uploadImage( req, res ) {
1357
1357
 
1358
1358
  async function createUser( data ) {
1359
1359
  try {
1360
- console.log( 'createUser ====>', data );
1360
+ // console.log( 'createUser ====>', data );
1361
1361
  let params = {
1362
1362
  userName: data.userName,
1363
1363
  email: data.email,
@@ -1825,7 +1825,7 @@ export async function redoTask( req, res ) {
1825
1825
  };
1826
1826
 
1827
1827
  let response = await taskProcessedService.updateOne( { _id: req.body.payload._id }, updateData );
1828
- console.log( response );
1828
+ // console.log( response );
1829
1829
  if ( response.modifiedCount || response.matchedCount ) {
1830
1830
  let storeTimeZone = await storeService.findOne( { storeName: taskDetails.storeName }, { 'storeProfile.timeZone': 1 } );
1831
1831
  let currentDateTime;
@@ -1865,7 +1865,7 @@ export async function redoTask( req, res ) {
1865
1865
  };
1866
1866
  let url = JSON.parse( process.env.LAMBDAURL );
1867
1867
  let searchResponse = await fetch( url.redoTask, requestOptions );
1868
- console.log( searchResponse.ok );
1868
+ // console.log( searchResponse.ok );
1869
1869
  if ( searchResponse.ok ) {
1870
1870
  return res.sendSuccess( 'Question redo successfully' );
1871
1871
  } else {
@@ -3714,7 +3714,7 @@ export async function updateAssign( req, res ) {
3714
3714
  let userData = {
3715
3715
  userName: assign.userName,
3716
3716
  email: assign.userEmail,
3717
- mobileNumber: assign?.phone || '',
3717
+ mobileNumber: assign?.userPhone || '',
3718
3718
  clientId: req.body.clientId,
3719
3719
  };
3720
3720
  userDetails = await createUser( userData );
@@ -3979,7 +3979,7 @@ export async function taskcreation( req, res ) {
3979
3979
 
3980
3980
 
3981
3981
  let finduser = await userService.findOne( { clientId: inputBody.clientId, email: req.body.user, userType: 'client', isActive: true }, { userName: '$userName', email: 1, userId: '$_id' } );
3982
- console.log( finduser );
3982
+ // console.log( finduser );
3983
3983
 
3984
3984
  if ( !finduser ) {
3985
3985
  return res.sendError( 'No user Found', 500 );
@@ -88,7 +88,7 @@ export const overallCardsV1 = async ( req, res ) => {
88
88
  resultData = { taskApproval: { count: taskCount?.[0]?.count || 0 }, checklistApproval: { count: checklistCount?.[0]?.count || 0 } };
89
89
  return res.sendSuccess( { cardData: resultData } );
90
90
  } catch ( error ) {
91
- console.log( 'error =>', error );
91
+ // console.log( 'error =>', error );
92
92
  logger.error( { error: error, function: 'overallCards' } );
93
93
  return res.sendError( error, 500 );
94
94
  }
@@ -366,7 +366,7 @@ export const overallCards = async ( req, res ) => {
366
366
  let resultData = await overallCardsData( requestData );
367
367
  return res.sendSuccess( resultData );
368
368
  } catch ( error ) {
369
- console.log( 'error =>', error );
369
+ // console.log( 'error =>', error );
370
370
  logger.error( { error: error, function: 'overallCards' } );
371
371
  return res.sendError( error, 500 );
372
372
  }
@@ -385,7 +385,7 @@ async function overallCardsData( requestData ) {
385
385
  // resultData.card = cardData;
386
386
  return { cardData: cardData };
387
387
  } catch ( error ) {
388
- console.log( 'error =>', error );
388
+ // console.log( 'error =>', error );
389
389
  logger.error( { error: error, message: data, function: 'overallCardsData' } );
390
390
  }
391
391
  }
@@ -396,7 +396,7 @@ export const approvalTable = async ( req, res ) => {
396
396
  let resultData = await approvalTableData( requestData );
397
397
  return res.sendSuccess( resultData );
398
398
  } catch ( error ) {
399
- console.log( 'error =>', error );
399
+ // console.log( 'error =>', error );
400
400
  logger.error( { error: error, function: 'taskTable' } );
401
401
  return res.sendError( error, 500 );
402
402
  }
@@ -463,7 +463,7 @@ async function approvalTableData( requestData ) {
463
463
  };
464
464
  return tableData;
465
465
  } catch ( error ) {
466
- console.log( 'error =>', error );
466
+ // console.log( 'error =>', error );
467
467
  logger.error( { error: error, message: requestData, function: 'approvalTableData' } );
468
468
  return res.sendError( error, 500 );
469
469
  }
@@ -475,7 +475,7 @@ export const activityLog = async ( req, res ) => {
475
475
  let resultData = await activityLogData( requestData );
476
476
  return res.sendSuccess( resultData );
477
477
  } catch ( error ) {
478
- console.log( 'error =>', error );
478
+ // console.log( 'error =>', error );
479
479
  logger.error( { error: error, function: 'activityLog' } );
480
480
  return res.sendError( error, 500 );
481
481
  }
@@ -538,7 +538,7 @@ async function activityLogData( requestData ) {
538
538
  };
539
539
  return activityLogData;
540
540
  } catch ( error ) {
541
- console.log( 'error =>', error );
541
+ // console.log( 'error =>', error );
542
542
  logger.error( { error: error, message: requestData, function: 'activityLogData' } );
543
543
  return res.sendError( error, 500 );
544
544
  }
@@ -11,7 +11,7 @@ export const overallCards = async ( req, res ) => {
11
11
  let resultData = await overallCardsData( requestData );
12
12
  return res.sendSuccess( resultData );
13
13
  } catch ( error ) {
14
- console.log( 'error =>', error );
14
+ // console.log( 'error =>', error );
15
15
  logger.error( { error: error, function: 'overallCards' } );
16
16
  return res.sendError( error, 500 );
17
17
  }
@@ -42,7 +42,7 @@ async function overallCardsData( requestData ) {
42
42
  // resultData.card = cardData;
43
43
  return { cardData: cardData };
44
44
  } catch ( error ) {
45
- console.log( 'error =>', error );
45
+ // console.log( 'error =>', error );
46
46
  logger.error( { error: error, message: data, function: 'overallCardsData' } );
47
47
  }
48
48
  }
@@ -108,7 +108,6 @@ export const overallCardsV1 = async ( req, res ) => {
108
108
  };
109
109
  export const taskTableV1 = async ( req, res ) => {
110
110
  try {
111
- console.log( 'req.body', req.body );
112
111
  let limit = parseInt( req.body.limit ) || 10;
113
112
  let offset = parseInt( req.body.offset - 1 ) || 0;
114
113
  let page = offset * limit;
@@ -190,7 +189,7 @@ export const taskTableV1 = async ( req, res ) => {
190
189
  { $sort: { createdAt: -1 } },
191
190
  );
192
191
  }
193
- console.log( 'page', page );
192
+ // console.log( 'page', page );
194
193
  query.push( {
195
194
  $facet: {
196
195
  data: [
@@ -221,7 +220,7 @@ export const taskTableV1 = async ( req, res ) => {
221
220
 
222
221
  return res.sendSuccess( { taskTableData: checkList[0].data, totalCount: checkList[0].count[0].totalCount } );
223
222
  } catch ( e ) {
224
- console.log( 'e', e );
223
+ // console.log( 'e', e );
225
224
  logger.error( 'checklist =>', e );
226
225
  return res.sendError( e, 500 );
227
226
  }
@@ -422,7 +421,7 @@ export const taskInfoTableV1 = async ( req, res ) => {
422
421
  }
423
422
  return res.sendSuccess( result );
424
423
  } catch ( error ) {
425
- console.log( 'error =>', error );
424
+ // console.log( 'error =>', error );
426
425
  logger.error( { error: error, message: req.query, function: 'taskInfo' } );
427
426
  return res.sendError( { error: error }, 500 );
428
427
  }
@@ -434,7 +433,7 @@ export const taskTable = async ( req, res ) => {
434
433
  let resultData = await taskTableData( requestData );
435
434
  return res.sendSuccess( resultData );
436
435
  } catch ( error ) {
437
- console.log( 'error =>', error );
436
+ // console.log( 'error =>', error );
438
437
  logger.error( { error: error, function: 'taskTable' } );
439
438
  return res.sendError( error, 500 );
440
439
  }
@@ -528,7 +527,7 @@ async function taskTableData( requestData ) {
528
527
  };
529
528
  return tableData;
530
529
  } catch ( error ) {
531
- console.log( 'error =>', error );
530
+ // console.log( 'error =>', error );
532
531
  logger.error( { error: error, message: requestData, function: 'taskTableData' } );
533
532
  return res.sendError( error, 500 );
534
533
  }
@@ -540,7 +539,7 @@ export const taskInfoTable = async ( req, res ) => {
540
539
  let resultData = await taskInfoTableData( requestData );
541
540
  return res.sendSuccess( resultData );
542
541
  } catch ( error ) {
543
- console.log( 'error =>', error );
542
+ // console.log( 'error =>', error );
544
543
  logger.error( { error: error, function: 'taskInfoTable' } );
545
544
  return res.sendError( error, 500 );
546
545
  }
@@ -674,7 +673,7 @@ async function taskInfoTableData( requestData ) {
674
673
  };
675
674
  return tableInfoData;
676
675
  } catch ( error ) {
677
- console.log( 'error =>', error );
676
+ // console.log( 'error =>', error );
678
677
  logger.error( { error: error, message: requestData, function: 'tableInfoData' } );
679
678
  return res.sendError( error, 500 );
680
679
  }
@@ -685,7 +684,7 @@ export const taskDropdownList = async ( req, res ) => {
685
684
  let resultData = await taskDropdownListData( requestData );
686
685
  return res.sendSuccess( resultData );
687
686
  } catch ( error ) {
688
- console.log( 'error =>', error );
687
+ // console.log( 'error =>', error );
689
688
  logger.error( { error: error, function: 'taskDropdownList' } );
690
689
  return res.sendError( error, 500 );
691
690
  }
@@ -738,7 +737,7 @@ async function taskDropdownListData( requestData ) {
738
737
  };
739
738
  return taskDropdownListData;
740
739
  } catch ( error ) {
741
- console.log( 'error =>', error );
740
+ // console.log( 'error =>', error );
742
741
  logger.error( { error: error, message: requestData, function: 'taskDropdownListData' } );
743
742
  return res.sendError( error, 500 );
744
743
  }
@@ -799,7 +798,7 @@ export const taskDropdownListV1 = async ( req, res ) => {
799
798
  result.taskDropdown = getChecklistData;
800
799
  return res.sendSuccess( result );
801
800
  } catch ( error ) {
802
- console.log( 'error =>', error );
801
+ // console.log( 'error =>', error );
803
802
  logger.error( { error: error, message: req.query, function: 'checklistDropdown' } );
804
803
  return res.sendError( { error: error }, 500 );
805
804
  }
@@ -907,7 +906,7 @@ export const taskDropdownListNew = async ( req, res ) => {
907
906
  result.taskDropdown = getChecklistData;
908
907
  return res.sendSuccess( result );
909
908
  } catch ( error ) {
910
- console.log( 'error =>', error );
909
+ // console.log( 'error =>', error );
911
910
  logger.error( { error: error, message: req.query, function: 'checklistDropdownV1' } );
912
911
  return res.sendError( { error: error }, 500 );
913
912
  }
@@ -918,7 +917,7 @@ export const taskInfoView = async ( req, res ) => {
918
917
  let resultData = await taskInfoViewData( requestData );
919
918
  return res.sendSuccess( resultData );
920
919
  } catch ( error ) {
921
- console.log( 'error =>', error );
920
+ // console.log( 'error =>', error );
922
921
  logger.error( { error: error, function: 'taskInfoView' } );
923
922
  return res.sendError( error, 500 );
924
923
  }
@@ -949,7 +948,7 @@ async function taskInfoViewData( requestData ) {
949
948
  };
950
949
  return taskInfoViewData;
951
950
  } catch ( error ) {
952
- console.log( 'error =>', error );
951
+ // console.log( 'error =>', error );
953
952
  logger.error( { error: error, message: requestData, function: 'taskInfoViewData' } );
954
953
  return res.sendError( error, 500 );
955
954
  }
@@ -964,7 +963,7 @@ export const taskDeleteV1 = async ( req, res ) => {
964
963
 
965
964
  const taskConfig = await taskService.findOne( { _id: new mongoose.Types.ObjectId( requestData.taskId ) }, { _id: 1 } );
966
965
  if ( !taskConfig ) {
967
- console.log( 'Task found:', taskConfig );
966
+ // console.log( 'Task found:', taskConfig );
968
967
  return res.sendError( 'Task not found', 404 );
969
968
  }
970
969
 
@@ -974,7 +973,7 @@ export const taskDeleteV1 = async ( req, res ) => {
974
973
  );
975
974
 
976
975
  if ( resultData ) {
977
- console.log( 'Update result:', resultData );
976
+ // console.log( 'Update result:', resultData );
978
977
  return res.sendSuccess( { message: 'Task deleted successfully' } );
979
978
  } else {
980
979
  return res.sendError( 'Something went wrong please try again', 500 );