Include origins conditionally in eventQuery
This commit is contained in:
@@ -139,16 +139,14 @@
|
||||
if (this.origin) {
|
||||
origins.push(this.origin);
|
||||
}
|
||||
const variables = {range: this.range, origins: origins.length > 0 ? origins : null};
|
||||
if (this.hasUser) {
|
||||
findEventsAndOrigins(variables)
|
||||
.then(this.eventsFetched)
|
||||
.catch(this.eventsFailed);
|
||||
} else {
|
||||
findEvents(variables)
|
||||
.then(this.eventsFetched)
|
||||
.catch(this.eventsFailed);
|
||||
}
|
||||
const variables = {
|
||||
range: this.range,
|
||||
origins: origins.length > 0 ? origins : null,
|
||||
includeOrigins: this.hasUser
|
||||
};
|
||||
findEvents(variables)
|
||||
.then(this.eventsFetched)
|
||||
.catch(this.eventsFailed);
|
||||
},
|
||||
eventsFetched(response) {
|
||||
if (response.errors) {
|
||||
|
||||
Reference in New Issue
Block a user