Add first part of delete mutation call
This commit is contained in:
parent
5c05ed2a86
commit
3577ca1a2f
|
|
@ -112,6 +112,34 @@
|
||||||
})
|
})
|
||||||
.catch();
|
.catch();
|
||||||
},
|
},
|
||||||
|
deleteSnapshot() {
|
||||||
|
this.$modal.open('confirm')
|
||||||
|
.then(() => {
|
||||||
|
this.$apollo.mutate({
|
||||||
|
mutation: DELETE_SNAPSHOT_MUTATION,
|
||||||
|
variables: {
|
||||||
|
input: {
|
||||||
|
id: this.snapshot.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
update: (store, {data: {deleteSnapshot: {result}}}) => {
|
||||||
|
if (result.__typename === 'Success') {
|
||||||
|
const slug = this.$route.params.slug;
|
||||||
|
const query = SNAPSHOTS_QUERY;
|
||||||
|
const variables = {
|
||||||
|
slug
|
||||||
|
};
|
||||||
|
const module = store.readQuery({
|
||||||
|
query,
|
||||||
|
variables
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch();
|
||||||
|
},
|
||||||
share() {
|
share() {
|
||||||
this.$apollo.mutate({
|
this.$apollo.mutate({
|
||||||
mutation: SHARE_SNAPSHOT_MUTATION,
|
mutation: SHARE_SNAPSHOT_MUTATION,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue