activar cuenta

This commit is contained in:
2020-11-23 12:56:24 -06:00
parent 08610054db
commit 5df8e9e00d
6 changed files with 30 additions and 25 deletions
+4
View File
@@ -1,5 +1,6 @@
const validar = require('../../helper/validar');
const Servicio = require('../../db/tablas/Servicio');
const Usuario = require('../../db/tablas/Usuario');
const cancelar = async (body) => {
let idServicio = validar.validarId(body.idServicio);
@@ -9,6 +10,9 @@ const cancelar = async (body) => {
if (!res) throw new Error('No existe este servicio.');
if (res.idStatus === 10)
throw new Error('Este servicio ya fue cancelado');
return Usuario.update({ activo: false }, { where: res.idUsuario });
})
.then((res) => {
return Servicio.update({ idStatus: 10 }, { where: { idServicio } });
})
.then((res) => {
+1 -1
View File
@@ -43,7 +43,7 @@ const registro = async (body) => {
})
.then((res) => {
return Usuario.update(
{ password: encriptar.encriptar(password) },
{ password: encriptar.encriptar(password), activo: true },
{ where: { idUsuario } }
);
})