tango-app-api-trax 3.3.1-beta-33 → 3.3.1-beta-35
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
|
@@ -3512,7 +3512,7 @@ export const selectAssign = async ( req, res ) => {
|
|
|
3512
3512
|
// console.log( 'getUsers =>', getUsers );
|
|
3513
3513
|
let teamQuery = [
|
|
3514
3514
|
{ $match: { clientId: requestData.clientId } },
|
|
3515
|
-
{ $project: { 'teamName': 1, 'type': '
|
|
3515
|
+
{ $project: { 'teamName': 1, 'type': 'teams' } },
|
|
3516
3516
|
];
|
|
3517
3517
|
// let getTeams = await teamsServices.aggregateTeams( teamQuery );
|
|
3518
3518
|
// console.log( 'getTeams =>', getTeams );
|
|
@@ -3592,6 +3592,8 @@ async function assignUsers( data ) {
|
|
|
3592
3592
|
assignId: data?.id || clusterDetails?.[0]?._id,
|
|
3593
3593
|
coverage: 'store',
|
|
3594
3594
|
clusterName: clusterDetails?.[0]?.clusterName,
|
|
3595
|
+
storeId: store.storeId,
|
|
3596
|
+
storeName: store.storeName,
|
|
3595
3597
|
};
|
|
3596
3598
|
return userData;
|
|
3597
3599
|
} ) );
|
|
@@ -3704,13 +3706,15 @@ async function assignUsers( data ) {
|
|
|
3704
3706
|
},
|
|
3705
3707
|
},
|
|
3706
3708
|
];
|
|
3709
|
+
// console.log( 'data?.userEmail=>', data.userEmail );
|
|
3707
3710
|
let userDetails = await userService.aggregate( query );
|
|
3708
3711
|
if ( !userDetails.length ) {
|
|
3709
3712
|
let userData = {
|
|
3710
|
-
userName: data
|
|
3713
|
+
userName: data?.userEmail?.split( '@' )[0],
|
|
3711
3714
|
email: data.userEmail,
|
|
3712
3715
|
clientId: data.clientId,
|
|
3713
3716
|
};
|
|
3717
|
+
// console.log( userData, 'userData', data );
|
|
3714
3718
|
let details = await createUser( userData );
|
|
3715
3719
|
userDetails = [ details ];
|
|
3716
3720
|
}
|
|
@@ -3731,7 +3735,7 @@ async function assignUsers( data ) {
|
|
|
3731
3735
|
}
|
|
3732
3736
|
}
|
|
3733
3737
|
|
|
3734
|
-
console.log( assignedData, 'test', data );
|
|
3738
|
+
// console.log( assignedData, 'test', data );
|
|
3735
3739
|
if ( assignedData && !data.upload && data.insert ) {
|
|
3736
3740
|
await assignedService.updateOne( { checkListId: assignedData.checkListId, assignId: assignedData.assignId }, assignedData );
|
|
3737
3741
|
} else {
|
|
@@ -3767,7 +3771,7 @@ export async function checklistAssign( req, res ) {
|
|
|
3767
3771
|
coverage: req.body.coverage,
|
|
3768
3772
|
insert: false,
|
|
3769
3773
|
};
|
|
3770
|
-
console.log( assignedData, 'daterthj' );
|
|
3774
|
+
// console.log( assignedData, 'daterthj' );
|
|
3771
3775
|
let uploadData = await assignUsers( assignedData );
|
|
3772
3776
|
if ( uploadData ) {
|
|
3773
3777
|
if ( Array.isArray( uploadData ) ) {
|