
const { plan, info } = require('../../../../lib/db');

const json = async function (req, res, next) {
	try {
		const sequences = await plan.list(req.params.project, req.query) ?? [];
		const remarks = await info.get(req.params.project, "plan/remarks", req.query, req.user?.operations) ?? null;
		const response = {
			remarks,
			sequences
		};
		res.status(200).send(response);
		next();
	} catch (err) {
		next(err);
	}
};

module.exports = json;
