Files
dougal-software/lib/www/server/api/middleware/info/put.js
D. Berge f10103d396 Enfore info key access restrictions on the API.
Obviously, those keys can be edited freely at the database
level. This is intended.
2022-02-06 22:40:53 +01:00

17 lines
298 B
JavaScript

const { info } = require('../../../lib/db');
module.exports = async function (req, res, next) {
try {
const payload = req.body;
await info.put(req.params.project, req.params.path, payload, undefined, req.user.role);
res.status(201).send();
next();
} catch (err) {
next(err);
}
};