diff options
Diffstat (limited to 'src/store/groups.js')
-rw-r--r-- | src/store/groups.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/store/groups.js b/src/store/groups.js index 8df01b19..981e0932 100644 --- a/src/store/groups.js +++ b/src/store/groups.js @@ -105,6 +105,19 @@ const mutations = { } }) }, + + /** + * Add a group + * + * @param {Object} state the store data + * @param {string} groupName the name of the group + */ + addGroup(state, groupName) { + state.groups.push({ + name: groupName, + contacts: [], + }) + }, } const getters = { @@ -146,6 +159,16 @@ const actions = { removeContactToGroup(context, { groupName, contact }) { context.commit('removeContactToGroup', { groupName, contact }) }, + + /** + * Add a group + * + * @param {Object} context the store mutations + * @param {string} groupName the name of the group + */ + addGroup(context, groupName) { + context.commit('addGroup', groupName) + }, } export default { state, mutations, getters, actions } |