tango-app-api-trax 3.3.1-beta-59 → 3.3.1-beta-60

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-59",
3
+ "version": "3.3.1-beta-60",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2015,6 +2015,7 @@ export const validateUserv1 = async ( req, res ) => {
2015
2015
  newEmail: { $toLower: '$email' },
2016
2016
  isActive: 1,
2017
2017
  clientId: 1,
2018
+ userName: 1,
2018
2019
  },
2019
2020
  },
2020
2021
  {
@@ -2085,9 +2086,10 @@ export const validateUserv1 = async ( req, res ) => {
2085
2086
  } );
2086
2087
  } else {
2087
2088
  assignDetails.forEach( ( item ) => {
2088
- let getUserId = userDetails.find( ( user ) => user.newEmail.toLowerCase() == item.userEmail.toLowerCase() );
2089
- if ( getUserId ) {
2090
- item._id = getUserId._id;
2089
+ let getUserDetails = userDetails.find( ( user ) => user.newEmail.toLowerCase() == item.userEmail.toLowerCase() );
2090
+ if ( getUserDetails ) {
2091
+ item._id = getUserDetails._id;
2092
+ item.userName = getUserDetails.userName;
2091
2093
  }
2092
2094
  } );
2093
2095
  }
@@ -3730,6 +3732,7 @@ export async function updateAssign( req, res ) {
3730
3732
  clientId: req.body.clientId,
3731
3733
  };
3732
3734
  userDetails = await createUser( userData );
3735
+ userDetails = [ userDetails ];
3733
3736
  }
3734
3737
  let data = {
3735
3738
  ...assign,
@@ -3738,7 +3741,7 @@ export async function updateAssign( req, res ) {
3738
3741
  checkListId: req.body.checkListId,
3739
3742
  coverage: req.body.coverage,
3740
3743
  assignId: assign._id,
3741
- userId: userDetails._id,
3744
+ userId: userDetails?.[0]?._id,
3742
3745
  checkListName: checklistDetails.checkListName,
3743
3746
  };
3744
3747
  delete data._id;
@@ -16,7 +16,7 @@ traxRouter
16
16
  .post( '/validateUser', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( uploadUserValidation ), traxController.validateUser )
17
17
  .post( '/validateUserv1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( uploadUserValidation ), traxController.validateUserv1 )
18
18
  .get( '/userDetails/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetails )
19
- .get( '/userDetailsv1/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetailsv1 )
19
+ .get( '/userDetailsv1/:checklistId', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetailsv1 )
20
20
  .post( '/checklistConfigure', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.updateConfigure )
21
21
  .post( '/checklistConfigurev1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.updateConfigurev1 )
22
22
  .delete( '/deleteChecklist/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( duplicateValidation ), traxController.deleteChecklist )