Commit f264306a authored by rlacko's avatar rlacko 💬
Browse files

fix news error message

parent 09b0184b
Pipeline #4717 failed with stages
in 1 minute and 57 seconds
......@@ -20,12 +20,11 @@ exports.default.getOne = async (req, res) => {
} catch (err) {
if (err.name === 'CastError') {
// Throwed by Mongoose
console.error(err)
return res.status(422).json({ message: 'Invalid ID provided' })
}
console.error(err)
res.status(400).end()
res.status(500).end()
}
}
exports.default.getMany = async (req, res) => {
......@@ -43,7 +42,7 @@ exports.default.getMany = async (req, res) => {
})
} catch (err) {
console.error(err)
res, status(400).end()
res, status(500).end()
}
}
......@@ -66,6 +65,6 @@ exports.default.createOne = async (req, res) => {
}
console.error(err)
return res.status(400).end()
return res.status(500).end()
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment