const YAML = require('yaml');
const { event } = require('../../../../lib/db');

const yaml = async function (req, res, next) {
	try {
		const response = await event.list(req.params.project, req.query);
		res.status(200).send(YAML.stringify(response));
		next();
	} catch (err) {
		next(err);
	}
};

module.exports = yaml;
