We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45b516d commit 5c57e14Copy full SHA for 5c57e14
store/microvolunteering.js
@@ -21,6 +21,16 @@ export const mutations = {
21
}
22
},
23
24
+ addList(state, list) {
25
+ state.list = {}
26
+
27
+ if (list) {
28
+ for (const item of list) {
29
+ Vue.set(state.list, item.id, item)
30
+ }
31
32
+ },
33
34
clear(state) {
35
state.list = {}
36
@@ -48,10 +58,7 @@ export const actions = {
48
58
microvolunteerings
49
59
} = await this.$api.microvolunteering.fetch(params)
50
60
51
- microvolunteerings.forEach(m => {
52
- commit('add', m)
53
- })
54
-
61
+ commit('addList', microvolunteerings)
55
62
return context
56
63
57
64
0 commit comments