Files
dougal-software/lib/www/server/api/middleware/project/configuration/put.js
D. Berge efe64f0a8c Implement PUT method for project configuration endpoint.
In short:

POST creates a new project
PUT overwrites a project configuration with a new one
PATCH merges the request body with the existing configuration
2024-05-01 10:40:04 +02:00

17 lines
289 B
JavaScript

const { project } = require('../../../../lib/db');
module.exports = async function (req, res, next) {
try {
// TODO
// Implement If-Match header requirements
res.send(await project.configuration.put(req.params.project, req.body));
next();
} catch (err) {
next(err);
}
};