mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 12:47:08 +00:00
Add API endpoint to retrieve project configuration.
Only available to users with at least `write` access.
This commit is contained in:
@@ -95,6 +95,9 @@ app.map({
|
||||
'/project/:project/summary': {
|
||||
get: [ mw.project.summary.get ],
|
||||
},
|
||||
'/project/:project/configuration': {
|
||||
get: [ mw.auth.access.write, mw.project.configuration.get ], // Get project configuration
|
||||
},
|
||||
|
||||
/*
|
||||
* GIS endpoints
|
||||
|
||||
13
lib/www/server/api/middleware/project/configuration/get.js
Normal file
13
lib/www/server/api/middleware/project/configuration/get.js
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
const { project } = require('../../../../lib/db');
|
||||
|
||||
module.exports = async function (req, res, next) {
|
||||
|
||||
try {
|
||||
res.status(200).send(await project.configuration.get(req.params.project));
|
||||
next();
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
module.exports = {
|
||||
get: require('./get'),
|
||||
// post: require('./post'),
|
||||
// put: require('./put'),
|
||||
// patch: require('./patch'),
|
||||
// delete: require('./delete'),
|
||||
};
|
||||
@@ -2,4 +2,5 @@ module.exports = {
|
||||
get: require('./get'),
|
||||
post: require('./post'),
|
||||
summary: require('./summary'),
|
||||
configuration: require('./configuration'),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user