diff --git a/routes/shows.js b/routes/shows.js index 6fa25ec..77ad238 100644 --- a/routes/shows.js +++ b/routes/shows.js @@ -40,6 +40,11 @@ showsRouter.get('/', function (req, res, next) { prisma.serie.findMany(filter) .then(shows => res.send({ shows })) + .catch(error => { + if (error instanceof Prisma.PrismaClientValidationError) { + next(createHttpError(400, 'Incorrect field in sort query.')) + } + }) }) showsRouter.get('/:id', function (req, res, next) {