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

module.exports = async function (req, res, next) {

	try {
		if (req.params.project && req.params.filename) {
			await event.unimport(req.params.project, req.params.filename, req.query);
			res.status(204).end();
		} else {
			res.status(400).send({message: "Malformed request"});
		}
		next();
	} catch (err) {
		next(err);
	}

};
