Skip to content

Commit

Permalink
added res.status in user-controller
Browse files Browse the repository at this point in the history
  • Loading branch information
naopeke committed Mar 29, 2024
1 parent e3c0e1a commit 3e45263
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 1 addition & 3 deletions src/controller/user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const registerUser = async (req, res, next) => {
let sqlEmail = "SELECT emailUser from magydeck.user WHERE emailUser = '" + user.emailUser + "'";
let [checkEmail] = await pool.query(sqlEmail);
if(checkEmail.length){
respuesta.error = true;
respuesta.codigo = 400;
respuesta.mensaje = 'Ya existe un usuario con este email';
res.status(400).json({error: true, codigo: 400, mensaje: 'Ya existe un usuario con este email'});
} else {
let sql = "INSERT INTO magydeck.user (nameUser, emailUser, passwordUser)" +
"VALUES ('" + user.nameUser + "', '" +
Expand Down
8 changes: 0 additions & 8 deletions src/models/respuesta.ts

This file was deleted.

0 comments on commit 3e45263

Please sign in to comment.