checking language aswell

This commit is contained in:
Jack 2021-10-11 14:32:57 +01:00
parent c27efc1545
commit 5719158aec

View file

@ -22,7 +22,7 @@ class NewQuotesController {
try {
let { uid } = req.decodedToken;
let { text, source, language } = req.body;
if (text === "" || source === "") {
if (!text || !source || !language) {
throw new MonkeyError(400, "Please fill all the fields");
}
let data = await NewQuotesDAO.add(text, source, language, uid);