Merge branch '262-preset-remarks-and-labels-no-longer-working-with-api-0-4-0' into 'devel'

Resolve "Preset remarks and labels no longer working with API 0.4.0"

Closes #262

See merge request wgp/dougal/software!36
This commit is contained in:
D. Berge
2023-09-10 10:10:22 +00:00
2 changed files with 9 additions and 8 deletions

View File

@@ -1,10 +1,11 @@
const { label } = require('../../../lib/db');
const { project } = require('../../../lib/db');
module.exports = async function (req, res, next) {
try {
res.status(200).send(await label.list(req.params.project, req.query));
const labels = (await project.configuration.get(req.params.project))?.labels ?? {};
res.status(200).send(labels);
next();
} catch (err) {
next(err);