Make sure invalid fields are filtered out
This commit is contained in:
parent
da64cea7c4
commit
2cb0f5280a
|
@ -914,8 +914,10 @@ SQLConnector.prototype.buildColumnNames = function(model, filter) {
|
|||
var self = this;
|
||||
var keys = Object.keys(cols);
|
||||
if (Array.isArray(fieldsFilter) && fieldsFilter.length > 0) {
|
||||
// No empty array, including all the fields
|
||||
keys = fieldsFilter;
|
||||
// Not empty array, including all the fields that are valid properties
|
||||
keys = fieldsFilter.filter(function(f) {
|
||||
return cols[f];
|
||||
});
|
||||
} else if ('object' === typeof fieldsFilter &&
|
||||
Object.keys(fieldsFilter).length > 0) {
|
||||
// { field1: boolean, field2: boolean ... }
|
||||
|
|
Loading…
Reference in New Issue