tango-app-api-trax 3.7.39 → 3.7.40
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
|
@@ -3188,3 +3188,27 @@ async function findAnswer( type ) {
|
|
|
3188
3188
|
return [];
|
|
3189
3189
|
}
|
|
3190
3190
|
}
|
|
3191
|
+
|
|
3192
|
+
export async function checklistTaskSubmissionDetails( req, res ) {
|
|
3193
|
+
try {
|
|
3194
|
+
if ( !req.body?.type ) {
|
|
3195
|
+
return res.sendError( 'Type is required', 400 );
|
|
3196
|
+
}
|
|
3197
|
+
if ( !req.body.checklistId ) {
|
|
3198
|
+
return res.sendError( 'Checklist Id is required', 400 );
|
|
3199
|
+
}
|
|
3200
|
+
if ( !req.body.date ) {
|
|
3201
|
+
return res.sendError( 'Date is required', 400 );
|
|
3202
|
+
}
|
|
3203
|
+
let details = [];
|
|
3204
|
+
if ( req.body.type == 'checklist' ) {
|
|
3205
|
+
details = await processedchecklist.find( { sourceCheckList_id: req.body.checklistId, date_iso: new Date( dayjs( req.body.date ).format( 'YYYY-MM-DD' ) ) }, { submitTime: '$submitTime_string', status: '$checklistStatus', approvalStatus: '$approvalStatus', approvalTime: '$approvalTime_string', _id: 0 } );
|
|
3206
|
+
} else {
|
|
3207
|
+
details = await processedTaskService.find( { sourceCheckList_id: req.body.checklistId, date_iso: new Date( dayjs( req.body.date ).format( 'YYYY-MM-DD' ) ) }, { submitTime: '$submitTime_string', status: '$checklistStatus', approvalStatus: '$approvalStatus', approvalTime: '$approvalTime_string', _id: 0 } );
|
|
3208
|
+
}
|
|
3209
|
+
return res.sendSuccess( details );
|
|
3210
|
+
} catch ( e ) {
|
|
3211
|
+
logger.error( { functionName: 'submissionDetails', error: e } );
|
|
3212
|
+
return res.sendError( e, 500 );
|
|
3213
|
+
}
|
|
3214
|
+
}
|
|
@@ -34,6 +34,7 @@ internalTraxRouter
|
|
|
34
34
|
.get( '/submittedList', isAllowedInternalAPIHandler, internalController.submittedList )
|
|
35
35
|
.get( '/getSubmittedDetails', isAllowedInternalAPIHandler, internalController.submittedInfo )
|
|
36
36
|
.post( '/checklistCreation', isAllowedInternalAPIHandler, internalController.checklistCreation )
|
|
37
|
+
.post( '/getSubmissionDetails', isAllowedInternalAPIHandler, internalController.checklistTaskSubmissionDetails )
|
|
37
38
|
;
|
|
38
39
|
|
|
39
40
|
|