tango-app-api-task 3.3.1-beta-5 → 3.3.1-beta-7
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
|
@@ -1535,18 +1535,16 @@ export async function reinitiateTask( req, res ) {
|
|
|
1535
1535
|
export async function createChecklistTask( req, res ) {
|
|
1536
1536
|
try {
|
|
1537
1537
|
let inputBody = req.body;
|
|
1538
|
-
let
|
|
1539
|
-
|
|
1540
|
-
if ( !
|
|
1538
|
+
let userDetailList;
|
|
1539
|
+
userDetailList = await userService.findOne( { email: inputBody.userEmail } );
|
|
1540
|
+
if ( !userDetailList ) {
|
|
1541
1541
|
let userData = {
|
|
1542
1542
|
userName: inputBody.userName,
|
|
1543
1543
|
email: inputBody.userEmail,
|
|
1544
1544
|
mobileNumber: '',
|
|
1545
1545
|
clientId: inputBody.clientId,
|
|
1546
1546
|
};
|
|
1547
|
-
|
|
1548
|
-
} else {
|
|
1549
|
-
userId = userDetails._id;
|
|
1547
|
+
userDetailList = await createUser( userData );
|
|
1550
1548
|
}
|
|
1551
1549
|
|
|
1552
1550
|
// let title = `New Task Alert ${inputBody.checkListName}`;
|
|
@@ -1658,8 +1656,8 @@ export async function createChecklistTask( req, res ) {
|
|
|
1658
1656
|
checkListId: response?._id,
|
|
1659
1657
|
checkListName: data.checkListName,
|
|
1660
1658
|
client_id: inputBody.clientId,
|
|
1661
|
-
userId:
|
|
1662
|
-
assignId: storeDetails?._id,
|
|
1659
|
+
userId: userDetailList._id,
|
|
1660
|
+
assignId: response?.coverage == 'store' ? storeDetails?._id : userDetailList._id,
|
|
1663
1661
|
coverage: response?.coverage || 'store',
|
|
1664
1662
|
};
|
|
1665
1663
|
await taskAssignService.create( userDetails );
|
|
@@ -160,6 +160,7 @@ export const approvalTableV1 = async ( req, res ) => {
|
|
|
160
160
|
},
|
|
161
161
|
},
|
|
162
162
|
coverage: { $first: '$coverage' },
|
|
163
|
+
userName: { $first: '$userName' },
|
|
163
164
|
},
|
|
164
165
|
},
|
|
165
166
|
{
|
|
@@ -179,6 +180,7 @@ export const approvalTableV1 = async ( req, res ) => {
|
|
|
179
180
|
storeName: 1,
|
|
180
181
|
redo: '$_id.redoType',
|
|
181
182
|
coverage: 1,
|
|
183
|
+
userName: 1,
|
|
182
184
|
},
|
|
183
185
|
},
|
|
184
186
|
{
|