

240822 정다정 store에 지문 관련 데이터 저장
@77ad457f469e1b2067e4e25b891aa8b40cde2b8e
--- client/views/pages/AppStore.js
+++ client/views/pages/AppStore.js
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 |
prblmTypeId: null, |
15 | 15 |
currentLabel: null, |
16 | 16 |
currentProblemIndex: 0, |
17 |
+ textId: null, |
|
17 | 18 |
}, |
18 | 19 |
getters: { |
19 | 20 |
isLoggedIn(state) { |
... | ... | @@ -40,12 +41,15 @@ |
40 | 41 |
getLearningId(state) { |
41 | 42 |
return state.learningId; |
42 | 43 |
}, |
44 |
+ getTextId(state) { |
|
45 |
+ return state.textId; |
|
46 |
+ }, |
|
43 | 47 |
currentLearningId(state) { |
44 | 48 |
return state.currentLearningIds[state.currentProblemIndex]; |
45 | 49 |
}, |
46 |
- currentLabel: state => state.currentLabel, |
|
47 |
- currentProblemIndex: state => state.currentProblemIndex, |
|
48 |
- prblmTypeId: state => state.prblmTypeId, |
|
50 |
+ currentLabel: (state) => state.currentLabel, |
|
51 |
+ currentProblemIndex: (state) => state.currentProblemIndex, |
|
52 |
+ prblmTypeId: (state) => state.prblmTypeId, |
|
49 | 53 |
}, |
50 | 54 |
mutations: { |
51 | 55 |
setToken(state, token) { |
... | ... | @@ -82,6 +86,9 @@ |
82 | 86 |
setLearningId(state, learningId) { |
83 | 87 |
state.learningId = learningId; |
84 | 88 |
}, |
89 |
+ setTextId(state, textId) { |
|
90 |
+ state.textId = textId; |
|
91 |
+ }, |
|
85 | 92 |
setLearningData(state, payload) { |
86 | 93 |
state.currentLearningIds = payload.learning_id; // Array of IDs |
87 | 94 |
state.currentLabel = payload.label; |
... | ... | @@ -97,7 +104,7 @@ |
97 | 104 |
if (state.currentProblemIndex > 0) { |
98 | 105 |
state.currentProblemIndex--; |
99 | 106 |
} |
100 |
- } |
|
107 |
+ }, |
|
101 | 108 |
}, |
102 | 109 |
actions: { |
103 | 110 |
login({ commit }, token) { |
... | ... | @@ -136,13 +143,16 @@ |
136 | 143 |
commit("setLearningId", learningId); |
137 | 144 |
}, |
138 | 145 |
updateLearningData({ commit }, payload) { |
139 |
- commit('setLearningData', payload); |
|
146 |
+ commit("setLearningData", payload); |
|
147 |
+ }, |
|
148 |
+ updateTextId({ commit }, textId) { |
|
149 |
+ commit("setTextId", textId); |
|
140 | 150 |
}, |
141 | 151 |
goToNextProblem({ commit }) { |
142 |
- commit('incrementProblemIndex'); |
|
152 |
+ commit("incrementProblemIndex"); |
|
143 | 153 |
}, |
144 | 154 |
goToPreviousProblem({ commit }) { |
145 |
- commit('decrementProblemIndex'); |
|
146 |
- } |
|
155 |
+ commit("decrementProblemIndex"); |
|
156 |
+ }, |
|
147 | 157 |
}, |
148 | 158 |
}); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?