|
@@ -57,10 +57,10 @@ describe('mutations', () => {
|
|
// actions.js
|
|
// actions.js
|
|
import shop from '../api/shop'
|
|
import shop from '../api/shop'
|
|
|
|
|
|
-export const getAllProducts = ({ dispatch }) => {
|
|
|
|
- dispatch('REQUEST_PRODUCTS')
|
|
|
|
|
|
+export const getAllProducts = ({ commit }) => {
|
|
|
|
+ commit('REQUEST_PRODUCTS')
|
|
shop.getProducts(products => {
|
|
shop.getProducts(products => {
|
|
- dispatch('RECEIVE_PRODUCTS', products)
|
|
|
|
|
|
+ commit('RECEIVE_PRODUCTS', products)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
```
|
|
```
|