diff --git a/server/controller/Prestamo/regresarNumeroInventario.js b/server/controller/Prestamo/regresarNumeroInventario.js index 566f482..4ab19da 100644 --- a/server/controller/Prestamo/regresarNumeroInventario.js +++ b/server/controller/Prestamo/regresarNumeroInventario.js @@ -26,6 +26,8 @@ const regresarNumeroInventario = async (body) => { .then((res) => { if (!res) throw new Error('No existe un prestamo activo con este equipo.'); + if (!res.Equipo.enUso) + throw new Error('Aun no se ha entregado el equipo al usuario.'); idPrestamo = res.idPrestamo; return Equipo.update( { enUso: false, apartado: false },