diff --git a/client/src/components/modules/SnapshotListItem.vue b/client/src/components/modules/SnapshotListItem.vue index 25830075..62781f87 100644 --- a/client/src/components/modules/SnapshotListItem.vue +++ b/client/src/components/modules/SnapshotListItem.vue @@ -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,