TeamCollectionAdapter.ts (hoppscotch-2.0.0) | : | TeamCollectionAdapter.ts (hoppscotch-2.1.0) | ||
---|---|---|---|---|
skipping to change at line 385 | skipping to change at line 385 | |||
this.collections$.next(tree) | this.collections$.next(tree) | |||
} | } | |||
/** | /** | |||
* Registers the subscriptions to listen to team collection updates | * Registers the subscriptions to listen to team collection updates | |||
*/ | */ | |||
registerSubscriptions() { | registerSubscriptions() { | |||
this.teamCollectionAdded$ = apolloClient | this.teamCollectionAdded$ = apolloClient | |||
.subscribe({ | .subscribe({ | |||
query: gql` | query: gql` | |||
subscription TeamCollectionAdded($teamID: String!) { | subscription TeamCollectionAdded($teamID: ID!) { | |||
teamCollectionAdded(teamID: $teamID) { | teamCollectionAdded(teamID: $teamID) { | |||
id | id | |||
title | title | |||
parent { | parent { | |||
id | id | |||
} | } | |||
} | } | |||
} | } | |||
`, | `, | |||
variables: { | variables: { | |||
skipping to change at line 414 | skipping to change at line 414 | |||
requests: null, | requests: null, | |||
title: data.teamCollectionAdded.title, | title: data.teamCollectionAdded.title, | |||
}, | }, | |||
data.teamCollectionAdded.parent?.id | data.teamCollectionAdded.parent?.id | |||
) | ) | |||
}) | }) | |||
this.teamCollectionUpdated$ = apolloClient | this.teamCollectionUpdated$ = apolloClient | |||
.subscribe({ | .subscribe({ | |||
query: gql` | query: gql` | |||
subscription TeamCollectionUpdated($teamID: String!) { | subscription TeamCollectionUpdated($teamID: ID!) { | |||
teamCollectionUpdated(teamID: $teamID) { | teamCollectionUpdated(teamID: $teamID) { | |||
id | id | |||
title | title | |||
parent { | parent { | |||
id | id | |||
} | } | |||
} | } | |||
} | } | |||
`, | `, | |||
variables: { | variables: { | |||
skipping to change at line 438 | skipping to change at line 438 | |||
.subscribe(({ data }) => { | .subscribe(({ data }) => { | |||
this.updateCollection({ | this.updateCollection({ | |||
id: data.teamCollectionUpdated.id, | id: data.teamCollectionUpdated.id, | |||
title: data.teamCollectionUpdated.title, | title: data.teamCollectionUpdated.title, | |||
}) | }) | |||
}) | }) | |||
this.teamCollectionRemoved$ = apolloClient | this.teamCollectionRemoved$ = apolloClient | |||
.subscribe({ | .subscribe({ | |||
query: gql` | query: gql` | |||
subscription TeamCollectionRemoved($teamID: String!) { | subscription TeamCollectionRemoved($teamID: ID!) { | |||
teamCollectionRemoved(teamID: $teamID) | teamCollectionRemoved(teamID: $teamID) | |||
} | } | |||
`, | `, | |||
variables: { | variables: { | |||
teamID: this.teamID, | teamID: this.teamID, | |||
}, | }, | |||
}) | }) | |||
.subscribe(({ data }) => { | .subscribe(({ data }) => { | |||
this.removeCollection(data.teamCollectionRemoved) | this.removeCollection(data.teamCollectionRemoved) | |||
}) | }) | |||
this.teamRequestAdded$ = apolloClient | this.teamRequestAdded$ = apolloClient | |||
.subscribe({ | .subscribe({ | |||
query: gql` | query: gql` | |||
subscription TeamRequestAdded($teamID: String!) { | subscription TeamRequestAdded($teamID: ID!) { | |||
teamRequestAdded(teamID: $teamID) { | teamRequestAdded(teamID: $teamID) { | |||
id | id | |||
collectionID | collectionID | |||
request | request | |||
title | title | |||
} | } | |||
} | } | |||
`, | `, | |||
variables: { | variables: { | |||
teamID: this.teamID, | teamID: this.teamID, | |||
skipping to change at line 480 | skipping to change at line 480 | |||
request: translateToNewRequest( | request: translateToNewRequest( | |||
JSON.parse(data.teamRequestAdded.request) | JSON.parse(data.teamRequestAdded.request) | |||
), | ), | |||
title: data.teamRequestAdded.title, | title: data.teamRequestAdded.title, | |||
}) | }) | |||
}) | }) | |||
this.teamRequestUpdated$ = apolloClient | this.teamRequestUpdated$ = apolloClient | |||
.subscribe({ | .subscribe({ | |||
query: gql` | query: gql` | |||
subscription TeamRequestUpdated($teamID: String!) { | subscription TeamRequestUpdated($teamID: ID!) { | |||
teamRequestUpdated(teamID: $teamID) { | teamRequestUpdated(teamID: $teamID) { | |||
id | id | |||
collectionID | collectionID | |||
request | request | |||
title | title | |||
} | } | |||
} | } | |||
`, | `, | |||
variables: { | variables: { | |||
teamID: this.teamID, | teamID: this.teamID, | |||
skipping to change at line 505 | skipping to change at line 505 | |||
id: data.teamRequestUpdated.id, | id: data.teamRequestUpdated.id, | |||
collectionID: data.teamRequestUpdated.collectionID, | collectionID: data.teamRequestUpdated.collectionID, | |||
request: JSON.parse(data.teamRequestUpdated.request), | request: JSON.parse(data.teamRequestUpdated.request), | |||
title: data.teamRequestUpdated.title, | title: data.teamRequestUpdated.title, | |||
}) | }) | |||
}) | }) | |||
this.teamRequestDeleted$ = apolloClient | this.teamRequestDeleted$ = apolloClient | |||
.subscribe({ | .subscribe({ | |||
query: gql` | query: gql` | |||
subscription TeamRequestDeleted($teamID: String!) { | subscription TeamRequestDeleted($teamID: ID!) { | |||
teamRequestDeleted(teamID: $teamID) | teamRequestDeleted(teamID: $teamID) | |||
} | } | |||
`, | `, | |||
variables: { | variables: { | |||
teamID: this.teamID, | teamID: this.teamID, | |||
}, | }, | |||
}) | }) | |||
.subscribe(({ data }) => { | .subscribe(({ data }) => { | |||
this.removeRequest(data.teamRequestDeleted) | this.removeRequest(data.teamRequestDeleted) | |||
}) | }) | |||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added |