Include origins conditionally in eventQuery

This commit is contained in:
2019-03-13 15:21:39 +01:00
parent 4cbc7ec13a
commit b62856e9bb
4 changed files with 10 additions and 21 deletions
+8 -10
View File
@@ -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) {