diff --git a/api/http-validators/commum.js b/api/http-validators/commum.js index f1e0933..203f81c 100644 --- a/api/http-validators/commum.js +++ b/api/http-validators/commum.js @@ -1,7 +1,11 @@ const { ResponseError, Err, Response } = require('../util'); const campoObrigatorio = (nomeCampo, valor, options = { isRequest: true }) => { - if(typeof valor !== 'boolean' && !valor) { + const tipo = typeof valor; + if(tipo === 'number' && valor === 0) { + return; + } + if(tipo !== 'boolean' && !valor){ if(options.isRequest) { Err.throwError(Response.HTTP_STATUS.BAD_REQUEST, 997000, 1, { campo: nomeCampo }); } else { diff --git a/package.json b/package.json index c348126..07a1b38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qrpague-server-nodejs", - "version": "3.3.1", + "version": "3.3.2", "scripts": { "start": "pm2 start app.js", "debug": "node index.js",