mirror of
https://github.com/Floriansylvain/CineAllo.git
synced 2026-08-19 11:43:24 +02:00
Catch sort query error
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user