-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: use case insensitive filter names * fix: refactor filter count * fix: update FilterPlanter test
- Loading branch information
Showing
3 changed files
with
44 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
/* | ||
* A simple model for tree filter | ||
* A simple model for planter filter | ||
*/ | ||
|
||
export default class Filter { | ||
constructor(options) { | ||
Object.assign(this, options); | ||
} | ||
|
||
getBackloopString(includeFilterString = true) { | ||
//{{{ | ||
let result = ''; | ||
const prefix = includeFilterString ? '&filter[where]' : '&where'; | ||
getWhereObj() { | ||
let where = {}; | ||
|
||
if (this.personId) { | ||
result += `${prefix}[personId]=${this.personId}`; | ||
where.personId = this.personId; | ||
} | ||
|
||
if (this.id) { | ||
result += `${prefix}[id]=${this.id}`; | ||
where.id = this.id; | ||
} | ||
|
||
if (this.firstName) { | ||
result += `${prefix}[firstName]=${this.firstName}`; | ||
where.firstName = { | ||
ilike: this.firstName, | ||
}; | ||
} | ||
|
||
if (this.lastName) { | ||
result += `${prefix}[lastName]=${this.lastName}`; | ||
where.lastName = { | ||
ilike: this.lastName, | ||
}; | ||
} | ||
|
||
if (this.organizationId) { | ||
result += `${prefix}[organizationId]=${this.organizationId}`; | ||
where.organizationId = this.organizationId; | ||
} | ||
|
||
return result; | ||
//}}} | ||
return where; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters