Skip to content

Commit

Permalink
fix: planter org id filter (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins authored Feb 23, 2021
1 parent 2f71594 commit c2933c1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/models/FilterPlanter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,36 @@
*/

export default class Filter {

constructor(options) {
Object.assign(this, options)
Object.assign(this, options);
}

getBackloopString(includeFilterString=true) {
getBackloopString(includeFilterString = true) {
//{{{
let result = ''
const prefix = includeFilterString ? '&filter[where]' : '&where'
let result = '';
const prefix = includeFilterString ? '&filter[where]' : '&where';

if (this.personId) {
result += `${prefix}[personId]=${this.personId}`
result += `${prefix}[personId]=${this.personId}`;
}

if (this.id) {
result += `${prefix}[id]=${this.id}`
result += `${prefix}[id]=${this.id}`;
}

if (this.firstName) {
result += `${prefix}[firstName]=${this.firstName}`
result += `${prefix}[firstName]=${this.firstName}`;
}

if (this.lastName) {
result += `${prefix}[lastName]=${this.lastName}`
result += `${prefix}[lastName]=${this.lastName}`;
}

if (this.organizationId) {
result += `${prefix}[organizationId]=${this.organizationId}`;
}

return result
return result;
//}}}
}
}

0 comments on commit c2933c1

Please sign in to comment.