tango-app-api-trax 3.7.29 → 3.7.31

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.29",
3
+ "version": "3.7.31",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "mongodb": "^6.8.0",
28
28
  "nodemon": "^3.1.4",
29
29
  "path": "^0.12.7",
30
- "tango-api-schema": "^2.4.20",
30
+ "tango-api-schema": "^2.5.32",
31
31
  "tango-app-api-middleware": "^3.5.2",
32
32
  "url": "^0.11.4",
33
33
  "winston": "^3.13.1",
@@ -3746,7 +3746,7 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
3746
3746
  submittedDetails = await processedchecklist.find( query );
3747
3747
  }
3748
3748
  await Promise.all( allQuestion.map( async ( element4 ) => {
3749
- let getToken = userDetails.get( element4.userId.toString() );
3749
+ let getToken = userDetails.get( element4?.userId?.toString() );
3750
3750
  if ( getToken && element4?.sendNotification && showEdit ) {
3751
3751
  tokenList.push( getToken );
3752
3752
  }
@@ -4493,11 +4493,7 @@ export async function updateAssign( req, res ) {
4493
4493
  } else {
4494
4494
  removed = { user: [], store: [] };
4495
4495
  }
4496
- let storeProfileDetails;
4497
- if ( req.body.coverage == 'store' ) {
4498
- let storeList = req.body.assignedList.map( ( ele ) => ele?.storeId );
4499
- storeProfileDetails = await storeService.find( { storeId: { $in: storeList } }, { storeId: 1, city: '$storeProfile.city', country: '$storeProfile.country' } );
4500
- }
4496
+
4501
4497
  await assignedService.deleteMany( { checkListId: req.body.checkListId } );
4502
4498
  let assignedUserList = [];
4503
4499
  let userEmailList = req.body.assignedList.map( ( ele ) => ele.userEmail.toLowerCase() );
@@ -4515,6 +4511,11 @@ export async function updateAssign( req, res ) {
4515
4511
  },
4516
4512
  ];
4517
4513
  let assignUserDetails = await userService.aggregate( query );
4514
+ let storeProfileDetails;
4515
+ if ( req.body.coverage == 'store' ) {
4516
+ let storeList = req.body.assignedList.map( ( ele ) => ele?.storeId );
4517
+ storeProfileDetails = await storeService.find( { storeId: { $in: storeList } }, { storeId: 1, city: '$storeProfile.city', country: '$storeProfile.country', state: '$storeProfile.state' } );
4518
+ }
4518
4519
  for ( let assign of req.body.assignedList ) {
4519
4520
  let userDetails = assignUserDetails.find( ( ele ) => ele.email.toLowerCase() == assign.userEmail.toLowerCase() );
4520
4521
  if ( !userDetails ) {
@@ -4542,6 +4543,7 @@ export async function updateAssign( req, res ) {
4542
4543
  if ( findStore ) {
4543
4544
  data.city = findStore.city;
4544
4545
  data.country = findStore.country;
4546
+ data.state = findStore.state;
4545
4547
  }
4546
4548
  }
4547
4549
  delete data._id;