Cambio de usuario para la base y restriccion de validacion

This commit is contained in:
Andres2908
2022-03-04 12:53:47 -06:00
parent 2d7cf996d2
commit 7d4a8e150a
2 changed files with 7 additions and 12 deletions
+2
View File
@@ -17,11 +17,13 @@ const validarTicket = async (body) => {
{
where: {
folio: body.folio,
validacion: 2,
},
}
);
})
.then((res) => {
if (!res) throw new Error('Este ticket ya fue validado');
if (body.validacion === 0)
throw new Error(
'El administrador a declinado el ticket, ya que los datos no coinciden.'