Add first part of delete mutation call

This commit is contained in:
Ramon Wenger 2022-06-14 22:10:13 +02:00
parent 5c05ed2a86
commit 3577ca1a2f
1 changed files with 28 additions and 0 deletions

View File

@ -112,6 +112,34 @@
})
.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() {
this.$apollo.mutate({
mutation: SHARE_SNAPSHOT_MUTATION,