1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-11 13:42:56 +01:00
send/server/routes/params.js
2018-02-09 15:03:05 -08:00

16 lines
317 B
JavaScript

const storage = require('../storage');
module.exports = function(req, res) {
const dlimit = req.body.dlimit;
if (!dlimit || dlimit > 20) {
return res.sendStatus(400);
}
try {
storage.setField(req.params.id, 'dlimit', dlimit);
res.sendStatus(200);
} catch (e) {
res.sendStatus(404);
}
};