Setup routing for FruitDetails + fetch data on route transition + Fix fruit tests
This commit is contained in:
@@ -4,5 +4,9 @@ export default {
|
||||
getFruits: async ({ commit }) => {
|
||||
const response = await axios.get("http://localhost:3000/fruit");
|
||||
commit("setFruits", response.data.data);
|
||||
},
|
||||
getFruit: async ({ commit }, id) => {
|
||||
const response = await axios.get(`http://localhost:3000/fruit/${id}`);
|
||||
commit("setFruit", response.data);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user