drop.chapril.org-firefoxsend/server/routes/params.js

16 lines
317 B
JavaScript
Raw Normal View History

2017-11-30 22:41:09 +01:00
const storage = require('../storage');
2018-02-06 23:31:18 +01:00
module.exports = function(req, res) {
2017-11-30 22:41:09 +01:00
const dlimit = req.body.dlimit;
if (!dlimit || dlimit > 20) {
return res.sendStatus(400);
}
try {
2018-02-06 23:31:18 +01:00
storage.setField(req.params.id, 'dlimit', dlimit);
2017-11-30 22:41:09 +01:00
res.sendStatus(200);
} catch (e) {
res.sendStatus(404);
}
};