diff --git a/routes/shows.js b/routes/shows.js index 2835671..2373262 100644 --- a/routes/shows.js +++ b/routes/shows.js @@ -21,3 +21,19 @@ showsRouter.get('/:id', async function(req, res, next) { res.send({articles}) }) + +showsRouter.post('/', async function (req, res, next) { + try { + res.send(await prisma.serie.create({ + data: { + title: req.body.title, + date: req.body.date, + description: req.body.description, + thumbmailURL: req.body.thumbmailURL + } + })) + } catch (error) { + res.send({error, message: "You might want to check your Show data format / content."}) + } +}) +