fix: sonarcloud warning and code cleanup

This commit is contained in:
canove
2021-01-15 07:04:01 -03:00
parent 454fd6ce08
commit a0e6b7b2c7
11 changed files with 40 additions and 45 deletions

View File

@@ -35,8 +35,9 @@ const CreateUserService = async ({
"Check-email",
"An user with this email already exists.",
async value => {
if (!value) return false;
const emailExists = await User.findOne({
where: { email: value! }
where: { email: value }
});
return !emailExists;
}