mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:47:07 +00:00
19 lines
354 B
JavaScript
19 lines
354 B
JavaScript
|
|
const { info } = require('../../../lib/db');
|
|
|
|
module.exports = async function (req, res, next) {
|
|
|
|
try {
|
|
res.status(200).json(await info.get(req.params.project, req.params.path, req.query, req.user?.operations));
|
|
} catch (err) {
|
|
if (err instanceof TypeError) {
|
|
res.status(404).json(null);
|
|
} else {
|
|
next(err);
|
|
return;
|
|
}
|
|
}
|
|
next();
|
|
|
|
};
|