send/server/routes/delete.js

12 lines
222 B
JavaScript
Raw Normal View History

const storage = require('../storage');
module.exports = async function(req, res) {
try {
2019-02-12 19:50:06 +00:00
const id = req.params.id;
await storage.del(id);
2018-02-06 22:31:18 +00:00
res.sendStatus(200);
} catch (e) {
res.sendStatus(404);
}
};