mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-09 23:25:53 +08:00
checking if fields are empty
This commit is contained in:
parent
b7d5e64239
commit
ab955b102e
1 changed files with 3 additions and 0 deletions
|
@ -22,6 +22,9 @@ class NewQuotesController {
|
|||
try {
|
||||
let { uid } = req.decodedToken;
|
||||
let { text, source, language } = req.body;
|
||||
if (text === "" || source === "") {
|
||||
throw new MonkeyError(400, "Please fill all the fields");
|
||||
}
|
||||
let data = await NewQuotesDAO.add(text, source, language, uid);
|
||||
return res.status(200).json(data);
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue