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

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

	try {
		const payload = req.body;

		const line = await linename.post(req.params.project, payload);
		if (line) {
			res.status(200).type("text/plain").send(line);
		} else {
			res.status(404).send();
		}
		next();
	} catch (err) {
		next(err);
	}


};
