tango-app-api-trax 3.2.1-beta-2 → 3.2.1-beta-4
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
|
@@ -1792,7 +1792,9 @@ export async function submitChecklist( req, res ) {
|
|
|
1792
1792
|
// createdAt: createdAtDate,
|
|
1793
1793
|
// };
|
|
1794
1794
|
// await detectionService.create( detectionData );
|
|
1795
|
-
|
|
1795
|
+
if ( requestData.submittype == 'submit' ) {
|
|
1796
|
+
updateOpenSearch( req.user, requestData );
|
|
1797
|
+
}
|
|
1796
1798
|
|
|
1797
1799
|
return res.sendSuccess( 'Checklist Updated Successfully' );
|
|
1798
1800
|
} else {
|
|
@@ -1956,7 +1958,9 @@ export async function submitTask( req, res ) {
|
|
|
1956
1958
|
};
|
|
1957
1959
|
await checklistLogs.create( logInsertData );
|
|
1958
1960
|
|
|
1959
|
-
|
|
1961
|
+
if ( submittype == 'submit' ) {
|
|
1962
|
+
updateOpenSearchTask( user, requestData );
|
|
1963
|
+
}
|
|
1960
1964
|
|
|
1961
1965
|
return res.sendSuccess( 'Task Updated Successfully' );
|
|
1962
1966
|
} else {
|
|
@@ -2237,15 +2237,29 @@ async function insertPCBulkV3( getCLconfig, checklistId, currentdate, updatedche
|
|
|
2237
2237
|
await processedchecklist.insertMany( submitUser );
|
|
2238
2238
|
}
|
|
2239
2239
|
} else {
|
|
2240
|
-
let
|
|
2240
|
+
let deleteInprogressQuery = {
|
|
2241
2241
|
date_string: insertdata.date_string,
|
|
2242
2242
|
date_iso: insertdata.date_iso,
|
|
2243
2243
|
client_id: insertdata.client_id,
|
|
2244
2244
|
checkListId: updatedchecklist._id,
|
|
2245
|
-
checklistStatus: { $nin: [ 'submit' ] },
|
|
2245
|
+
checklistStatus: { $nin: [ 'submit', 'inprogress' ] },
|
|
2246
|
+
redoStatus: false,
|
|
2246
2247
|
};
|
|
2247
|
-
await processedchecklist.deleteMany(
|
|
2248
|
-
|
|
2248
|
+
await processedchecklist.deleteMany( deleteInprogressQuery );
|
|
2249
|
+
deleteInprogressQuery.checklistStatus = 'inprogress';
|
|
2250
|
+
deleteInprogressQuery.redoStatus = false;
|
|
2251
|
+
let getInprogressData = await processedchecklist.find( deleteInprogressQuery, { userId: 1, store_id: 1 } );
|
|
2252
|
+
if ( getInprogressData ) {
|
|
2253
|
+
allQuestion = allQuestion.filter( ( item ) => {
|
|
2254
|
+
let inprogressData = getInprogressData.find( ( ele ) => ele.userId.toString() == item.userId.toString() && ele.store_id == item.store_id );
|
|
2255
|
+
if ( !inprogressData ) {
|
|
2256
|
+
return item;
|
|
2257
|
+
}
|
|
2258
|
+
} );
|
|
2259
|
+
}
|
|
2260
|
+
if ( allQuestion.length ) {
|
|
2261
|
+
await processedchecklist.insertMany( allQuestion );
|
|
2262
|
+
}
|
|
2249
2263
|
}
|
|
2250
2264
|
} else {
|
|
2251
2265
|
let unAssignedList = allQuestion.reduce( ( acc, item ) => {
|