Skip to content

Commit 72cd65d

Browse files
committed
fix: hiddenProps and relations are arrays
1 parent e4111d8 commit 72cd65d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/postgresql.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,8 @@ PostgreSQL.prototype.buildJoin = function(model, filter) {
838838
break;
839839
}
840840

841-
if (candidateRelation in modelDefinition.settings.__hiddenRelations__) {
841+
if (Array.isArray(modelDefinition.settings.__hiddenRelations__) &&
842+
modelDefinition.settings.__hiddenRelations__.includes(candidateRelation)) {
842843
debug('Hidden relation for model %s skipping', parentModel);
843844
break;
844845
}
@@ -1083,7 +1084,8 @@ PostgreSQL.prototype._buildWhere = function(model, filter) {
10831084
}
10841085
let p = props[key];
10851086

1086-
if (p in modelDefinition.settings.__hiddenProps__) {
1087+
if (Array.isArray(modelDefinition.settings.__hiddenProps__) &&
1088+
modelDefinition.settings.__hiddenProps__.includes(p)) {
10871089
debug('Hidden prop for model %s skipping', model);
10881090
continue;
10891091
}

0 commit comments

Comments
 (0)