This repository has been archived on 2025-10-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
gekko/web/routes/deleteGekko.js
2021-06-06 20:25:14 +02:00

22 lines
399 B
JavaScript

const cache = require('../state/cache');
const gekkoManager = cache.get('gekkos');
// Deletes a gekko
// requires a post body with an id
module.exports = function *() {
let id = this.request.body.id;
if(!id) {
this.body = { status: 'not ok' }
return;
}
try {
gekkoManager.delete(id);
} catch(e) {
this.body = { status: e.message }
}
this.body = { status: 'ok' };
}