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:
D. Berge
2023-09-10 11:59:38 +02:00
parent 54fbc76da5
commit 941d15c1bc

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);