diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2018-09-28 17:57:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-28 17:57:13 +0200 |
commit | a8bc34669a327ebb9304add94b704c30c1271e06 (patch) | |
tree | 2b136e5828df343bfa979c4c4ae2230a8e8ea978 /src | |
parent | 4169161824c741093e85455c57314ee475088ffd (diff) | |
parent | 6fd9a75b9bc3fd61a693336ba91e566321c0f1f3 (diff) |
Merge pull request #650 from nextcloud/vue-ab-delete-update-contacts-fix
Delete the contacts from the store after an ab deletion
Diffstat (limited to 'src')
-rw-r--r-- | src/store/addressbooks.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/store/addressbooks.js b/src/store/addressbooks.js index b7828f4b..60db600f 100644 --- a/src/store/addressbooks.js +++ b/src/store/addressbooks.js @@ -260,7 +260,14 @@ const actions = { * @returns {Promise} */ async deleteAddressbook(context, addressbook) { - return addressbook.dav.delete().then((response) => context.commit('deleteAddressbook', addressbook)) + return addressbook.dav.delete() + .then((response) => { + // delete all the contacts from the store that belong to this addressbook + Object.values(addressbook.contacts) + .forEach(contact => context.commit('deleteContact', contact)) + // then delete the addressbook + context.commit('deleteAddressbook', addressbook) + }) .catch((error) => { throw error }) }, |