Skip to content
Snippets Groups Projects
Commit ef0eb17d authored by Fernando Erd's avatar Fernando Erd :ok_hand:
Browse files

Fix - null boolean

parent 527c6662
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!51Fix - null boolean
Pipeline #
......@@ -230,7 +230,15 @@ class ReqQueryFields {
if(value.where.type === 'integer') whereValue = parseInt(whereValue, 10);
if(value.where.type === 'double') whereValue = parseFloat(whereValue);
if(value.where.type === 'string') whereValue = '%'+whereValue+'%';
if(value.where.type === 'boolean') whereValue = (whereValue.toLowerCase() === 'true' || parseInt(whereValue, 10) === 1);
if(value.where.type === 'boolean') {
if (whereValue.toLowerCase() === 'null') {
whereValue = null;
console.log('Fazendo uma consulta Null');
} else {
whereValue = (whereValue.toLowerCase() === 'true' || parseInt(whereValue, 10) === 1);
console.log('Fazendo uma consulta True');
}
}
let tbl = value.where.table || value.table;
// multiple where, only tested for boolean filds
if (Array.isArray(value.tableField)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment