Add ability to submit new address book by providing displayName.

This commit is contained in:
suntala 2018-08-15 19:11:33 +02:00
parent 969497f158
commit 225b4674a3
3 changed files with 15 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -47,14 +47,6 @@ export default {
directives: {
clickOutside
},
// props: {
// addressbooks: {
// type: Array,
// default() {
// return {}
// }
// }
// },
data() {
return {
}
@ -68,15 +60,12 @@ export default {
/**
* Set new address book name
*
* @param {string} addressbook The address book
* @returns {Promise}
* @param {string} addressbook The address book name provided in the input
*
*/
addAddressbook() {
let addressbook = this.$refs.addressbook.value
// let addressbooks = this.$store.getters.getAddressbooks
// let newAddressbooksArray = addressbooks.push(addressbook)
// console.log(addressbook)
// ^ part of WIP
this.$store.dispatch('appendAddressbook', { displayName: addressbook })
}
}
}

View File

@ -209,6 +209,16 @@ const actions = {
})
},
/**
* Append a new address book to array of existing address books
*
* @param {Object} context
* @param {Object} addressbook The address book to append
*/
appendAddressbook(context, addressbook) {
context.commit('addAddressbooks', addressbook)
},
/**
* Retrieve the contacts of the specified addressbook
* and commit the results