tango-app-api-trax 1.0.0-alpha-task.135 → 1.0.0-alpha-task.136

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-trax",
3
- "version": "1.0.0-alpha-task.135",
3
+ "version": "1.0.0-alpha-task.136",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -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' );