Added edit and remove collection.

This commit is contained in:
Keith Holliday
2019-10-16 07:11:34 -06:00
parent 18a0c391f6
commit ed53b433b5
5 changed files with 88 additions and 6 deletions

View File

@@ -80,11 +80,27 @@ export const mutations = {
state.collections.push(newCollection);
},
removeCollection (state, payload) {
const { collectionIndex } = payload;
state.collections.splice(collectionIndex, 1)
},
saveCollection (state, payload) {
const { savedCollection } = payload;
state.collections[savedCollection.collectionIndex] = savedCollection;
},
addFolder (state, payload) {
const { collectionIndex, folder } = payload;
state.collections[collectionIndex].folders.push(folder);
},
removeFolder (state, payload) {
const { collectionIndex, folderIndex } = payload;
console.log(collectionIndex)
state.collections[collectionIndex].folders.splice(folderIndex, 1)
},
addRequest (state, payload) {
const { collectionIndex, folderIndex, request } = payload;
state.collections[collectionIndex].folders[folderIndex].push(request);