Develop #8
@@ -38,7 +38,8 @@ You've been given the task of creating a simple application with create/read/del
|
|||||||
- Setup API proxy with Axios
|
- Setup API proxy with Axios
|
||||||
- More Accessibility
|
- More Accessibility
|
||||||
- Component Lazy Loading
|
- Component Lazy Loading
|
||||||
- Inject axios globally as $http.
|
- Image Caching & Lazy Loading
|
||||||
|
- Inject axios globally as $http
|
||||||
- More test
|
- More test
|
||||||
|
|
||||||
### How much time (more or less) it took you to complete the task?
|
### How much time (more or less) it took you to complete the task?
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ export default {
|
|||||||
await axios
|
await axios
|
||||||
.post("http://localhost:3000/fruit", fruit)
|
.post("http://localhost:3000/fruit", fruit)
|
||||||
.then(res => commit("addFruit", res.data))
|
.then(res => commit("addFruit", res.data))
|
||||||
.catch(err => console.log(err))
|
.catch(err => {
|
||||||
|
throw new Error(err.message);
|
||||||
|
})
|
||||||
.finally(() => commit("setLoading", false));
|
.finally(() => commit("setLoading", false));
|
||||||
},
|
},
|
||||||
removeFruit: async ({ commit }, id) => {
|
removeFruit: async ({ commit }, id) => {
|
||||||
@@ -30,7 +32,9 @@ export default {
|
|||||||
commit("removeFruit", id);
|
commit("removeFruit", id);
|
||||||
commit("toggleDeleteMode");
|
commit("toggleDeleteMode");
|
||||||
})
|
})
|
||||||
.catch(err => console.log(err));
|
.catch(err => {
|
||||||
|
throw new Error(err.message);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getImageFromUnsplash: async ({ commit }, keyword) => {
|
getImageFromUnsplash: async ({ commit }, keyword) => {
|
||||||
commit("setLoading", true);
|
commit("setLoading", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user