validar numero entero

This commit is contained in:
xXpuma99Xx
2022-01-03 16:47:25 -06:00
parent dd4af627f5
commit a8335ffe1b
25 changed files with 161 additions and 55 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
const { validarId } = require('../../helper/validar');
const { validarNumeroEntero } = require('../../helper/validar');
const dbPath = '../../db/tablas';
const Carrito = require(`${dbPath}/Carrito`);
const update = async (body) => {
const idCarrito = validarId(body.idCarrito);
const idCarrito = validarNumeroEntero(body.idCarrito, 'id carrito', true);
let update = {};
if (body.activo === 'desactivar') update.activo = false;