mirror of https://github.com/nextcloud/contacts
Add ability to submit new address book by providing displayName.
This commit is contained in:
parent
969497f158
commit
225b4674a3
File diff suppressed because one or more lines are too long
|
@ -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 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue