Answer the question
In order to leave comments, you need to log in
Express.js - why doesn't work after .status().json()?
I tried to return json + status 400 from the server (code snippet, indents fell off):
if(!login) {
return res.status(400).json({ message: "Введите логин" });
}
if(!email){
return res.status(400).json({ message: "Введите Эл. Почту" });
}
const candidate = await User.findOne({ login });
if(candidate) {
return res.status(400).json({ message: "Такой аккаунт уже существует" });
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question