tango-app-api-trax 1.0.0-alpha-task.135 → 1.0.0-alpha-task.137
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
|
@@ -572,6 +572,12 @@ export const getPDFCSVChecklistDetails = async ( req, res ) => {
|
|
|
572
572
|
|
|
573
573
|
export async function cancelDownload( req, res ) {
|
|
574
574
|
try {
|
|
575
|
+
|
|
576
|
+
let finddata = await downloadService.findOne( { _id: req.params.id , status: 'completed' } );
|
|
577
|
+
if(finddata){
|
|
578
|
+
return res.sendError('Download Already Completed' ,500)
|
|
579
|
+
}
|
|
580
|
+
|
|
575
581
|
let update = await downloadService.updateOne( { _id: req.params.id }, { status: 'canceled' } );
|
|
576
582
|
if ( update ) {
|
|
577
583
|
return res.sendSuccess( 'Canceled Successfully' );
|
|
@@ -704,6 +704,7 @@ export const update = async ( req, res ) => {
|
|
|
704
704
|
sectionId.push( data._id );
|
|
705
705
|
if ( i == inputBody.sections.length - 1 ) {
|
|
706
706
|
await questionService.deleteMany( { checkListId: checkListId, client_id: req.body.clientId, _id: { $nin: sectionId } } );
|
|
707
|
+
await assignedService.updateMany( { checkListId: checkListId }, { checkListName: inputBody.checklistName } );
|
|
707
708
|
return res.sendSuccess( { checklistId: checkListId, msg: 'CheckList Created Successfully' } );
|
|
708
709
|
}
|
|
709
710
|
} ).catch( ( e ) => {
|