mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:37:07 +00:00
19 lines
329 B
JavaScript
19 lines
329 B
JavaScript
|
|
const { project } = require('../../../lib/db');
|
|
|
|
module.exports = async function (req, res, next) {
|
|
|
|
try {
|
|
const accessibleProjects = project.organisations.orgFilter(
|
|
req.user?.organisations,
|
|
await project.get(),
|
|
'read'
|
|
);
|
|
res.status(200).send(accessibleProjects);
|
|
next();
|
|
} catch (err) {
|
|
next(err);
|
|
}
|
|
|
|
};
|