mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:37:07 +00:00
Return labels directly from project configuration.
NOTE: This is a breaking API change. Before this it returned an array of labels, now it returns an object.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user