Drama-Project-Backend / controllers /playController.js
shashidharak99's picture
Upload project
547e0e1 verified
Raw
History Blame Contribute Delete
281 Bytes
const Play = require('../models/Play');
exports.createPlay = async (req, res) => {
try {
const play = new Play(req.body);
await play.save();
res.status(201).json(play);
} catch (err) {
res.status(400).json({ error: err.message });
}
};