var express = require('express');
var kue = require('kue');
var Bot = require('../models/bot');

var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index');
});

router.post('/destroy_jobs', function(req, res, next) {
  kue.Job.rangeByState('delayed', 0, 10000, 'asc', function( err, jobs ) {
    jobs.forEach(function(job) {
      job.remove(function() {});
    });
    res.send();
  });
});

router.post('/destroy_all_the_things', function(req, res, next) {
  kue.Job.rangeByState('delayed', 0, 10000, 'asc', function( err, jobs ) {
    jobs.forEach(function(job) {
      job.remove()
      .then(function(res) {
      })
      .catch(function(err) {
        res.status(500).send(err);
      });
    });
  });
  Bot.remove({})
  .then(function(result) {
  })
  .catch(function(err) {
    res.status(500).send(err);
  });
  res.send();
});

module.exports = router;

@@ -641,22 +641,8 @@
 ove(
-)%0A      .then(
 func
@@ -646,19 +646,19 @@
 unction(
-res
+err
 ) %7B%0A    
@@ -663,68 +663,30 @@
     
-%7D)%0A      .catch(function(err) %7B%0A        res.status(500).send
+  if (err) console.log
 (err

Fix error handler on remove job