Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
annyhe committed Jul 10, 2017
1 parent 046a5d5 commit e264c0d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/v1/helpers/verbs/findUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ function toSequelizeWhere(filter, props) {
if (Array.isArray(props.fieldsWithEnum) &&
props.fieldsWithEnum.indexOf(key) > -ONE) {

const enumArr = (props.fieldsToCamelCase.indexOf(key) === -ONE) ?
filter[key] : convertArrayElementsToCamelCase(filter[key]);
// if specified in props, convert the array in query to camelcase.
const enumArr = (props.fieldsToCamelCase &&
props.fieldsToCamelCase.indexOf(key) > -ONE) ?
convertArrayElementsToCamelCase(filter[key]) : filter[key];

// to use $in instead of $contains in toWhereClause
props.isEnum = true;
Expand Down

0 comments on commit e264c0d

Please sign in to comment.