tango-app-api-trax 3.3.1-beta-58 → 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
|
@@ -1972,7 +1972,7 @@ export const validateUserv1 = async ( req, res ) => {
|
|
|
1972
1972
|
|
|
1973
1973
|
const duplicateStores = Object.keys( duplicateStore ).filter( ( storeName ) => duplicateStore[storeName].count > 1 );
|
|
1974
1974
|
if ( duplicateStores.length ) {
|
|
1975
|
-
return res.
|
|
1975
|
+
return res.sendError( { validate: false, duplicates: duplicateStores, message: 'Store and email is duplicated' }, 400 );
|
|
1976
1976
|
}
|
|
1977
1977
|
} else {
|
|
1978
1978
|
const duplicateUser = assignDetails.reduce( ( acc, obj ) => {
|
|
@@ -1995,7 +1995,7 @@ export const validateUserv1 = async ( req, res ) => {
|
|
|
1995
1995
|
|
|
1996
1996
|
const duplicateUsers = Object.keys( duplicateUser ).filter( ( storeName ) => duplicateUser[storeName].count > 1 );
|
|
1997
1997
|
if ( duplicateUsers.length ) {
|
|
1998
|
-
return res.
|
|
1998
|
+
return res.sendError( { validate: false, duplicates: duplicateUsers, message: 'Email is Duplicated' }, 400 );
|
|
1999
1999
|
}
|
|
2000
2000
|
}
|
|
2001
2001
|
|
|
@@ -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
|
|
2089
|
-
if (
|
|
2090
|
-
item._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
|
|
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,
|
|
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 )
|