tango-app-api-trax 3.3.1-beta-71 → 3.3.1-beta-72

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.3.1-beta-71",
3
+ "version": "3.3.1-beta-72",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1989,17 +1989,15 @@ export const validateUserv1 = async ( req, res ) => {
1989
1989
  };
1990
1990
  } else {
1991
1991
  if ( acc[obj.userEmail.toLowerCase()] ) {
1992
- if ( acc[obj.userEmail.toLowerCase()].name.includes( obj.userName.toLowerCase() ) ) {
1993
- acc[obj.userEmail.toLowerCase()].count++;
1994
- } else {
1995
- acc[obj.userEmail.toLowerCase()].name.push( obj.userEmail.toLowerCase() );
1996
- }
1992
+ acc[obj.userEmail.toLowerCase()].name.push( obj.userName.toLowerCase() );
1993
+ acc[obj.userEmail.toLowerCase()].count++;
1997
1994
  }
1998
1995
  }
1999
1996
  return acc;
2000
1997
  }, {} );
2001
1998
 
2002
1999
  const duplicateUsers = Object.keys( duplicateUser ).filter( ( storeName ) => duplicateUser[storeName].count > 1 );
2000
+ console.log( duplicateUsers, 'user' );
2003
2001
  if ( duplicateUsers.length ) {
2004
2002
  return res.sendError( { validate: false, duplicates: duplicateUsers, message: 'Email is Duplicated' }, 400 );
2005
2003
  }
@@ -3318,16 +3316,11 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
3318
3316
 
3319
3317
  await processedchecklist.deleteMany( { userEmail: { $nin: userList }, date_string: insertdata.date_string, date_iso: insertdata.date_iso, client_id: insertdata.client_id, checkListId: updatedchecklist._id, checklistStatus: { $nin: [ 'submit' ] } } );
3320
3318
  if ( getCLconfig.coverage == 'store' ) {
3321
- await Promise.all( assignUserList.map( async ( item ) => {
3322
- if ( unAssignedList.hasOwnProperty( item.userEmail ) ) {
3323
- await processedchecklist.deleteMany( { date_string: insertdata.date_string, date_iso: insertdata.date_iso, client_id: insertdata.client_id, checkListId: updatedchecklist._id, $and: [ { userEmail: item.userEmail }, { store_id: { $nin: unAssignedList[item.userEmail] } } ], checklistStatus: { $nin: [ 'submit' ] } } );
3319
+ for ( let key in unAssignedList ) {
3320
+ if ( unAssignedList.hasOwnProperty( key ) ) {
3321
+ await processedchecklist.deleteMany( { date_string: insertdata.date_string, date_iso: insertdata.date_iso, client_id: insertdata.client_id, checkListId: updatedchecklist._id, $and: [ { userEmail: key }, { store_id: { $nin: unAssignedList[key] } } ], checklistStatus: { $nin: [ 'submit' ] } } );
3324
3322
  }
3325
- } ) );
3326
- // for ( let key in unAssignedList ) {
3327
- // if ( unAssignedList.hasOwnProperty( key ) ) {
3328
- // await processedchecklist.deleteMany( { date_string: insertdata.date_string, date_iso: insertdata.date_iso, client_id: insertdata.client_id, checkListId: updatedchecklist._id, $and: [ { userEmail: key }, { store_id: { $nin: unAssignedList[key] } } ], checklistStatus: { $nin: [ 'submit' ] } } );
3329
- // }
3330
- // }
3323
+ }
3331
3324
  }
3332
3325
 
3333
3326
  let inprogressData = await processedchecklist.find( {