summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-09-28 19:01:30 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-09-28 19:01:30 +0200
commit1486a2d78ebc995bf8f16df9d3158dc8e85d4afa (patch)
tree4024795413dc8eaf7dbd6ea6aa123dc34dda1ba4 /src
parentf285b76b6c18e9f9642dde9ea1a8a25efb67ee4a (diff)
parenta8bc34669a327ebb9304add94b704c30c1271e06 (diff)
Merge branch 'vue' of https://github.com/nextcloud/contacts into vue
Diffstat (limited to 'src')
-rw-r--r--src/store/addressbooks.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/store/addressbooks.js b/src/store/addressbooks.js
index 5906e909..15287c9b 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 })
},