forked from Greenstand/treetracker-wallet-admin-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/v2' into create-trust-relationship
- Loading branch information
Showing
9 changed files
with
384 additions
and
350 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
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,28 +1,28 @@ | ||
import { getDateText } from "../utils/formatting"; | ||
import { getDateText } from '../utils/formatting'; | ||
|
||
export default class TrustRelationshipsFilter { | ||
// possible query options | ||
state; | ||
type; | ||
requestType; | ||
before; | ||
after; | ||
constructor(options) { | ||
// assign options properties to created instance | ||
Object.assign(this, options); | ||
} | ||
// where object contains the query options | ||
getWhereObj() { | ||
let where = {}; | ||
if (this.state) where.state = this.state.toLowerCase(); | ||
if (this.type) where.type = this.type.toLowerCase(); | ||
if (this.requestType) where.requestType = this.requestType.toLowerCase(); | ||
if (this.before) where.before = getDateText(this.before, 'YYYY-MM-DD'); | ||
if (this.after) where.after = getDateText(this.after, 'YYYY-MM-DD'); | ||
return where; | ||
} | ||
} | ||
// possible query options | ||
state; | ||
type; | ||
request_type; | ||
before; | ||
after; | ||
|
||
constructor(options) { | ||
// assign options properties to created instance | ||
Object.assign(this, options); | ||
} | ||
|
||
// where object contains the query options | ||
getWhereObj() { | ||
let where = {}; | ||
|
||
if (this.state) where.state = this.state.toLowerCase(); | ||
if (this.type) where.type = this.type.toLowerCase(); | ||
if (this.request_type) where.request_type = this.request_type.toLowerCase(); | ||
if (this.before) where.before = getDateText(this.before, 'YYYY-MM-DD'); | ||
if (this.after) where.after = getDateText(this.after, 'YYYY-MM-DD'); | ||
|
||
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
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
Oops, something went wrong.