Test mutation + actions

This commit is contained in:
2020-12-18 05:44:23 +01:00
parent 734b924390
commit 18be371f39
5 changed files with 83 additions and 39 deletions

View File

@@ -10,8 +10,12 @@ export const mutations = {
export const actions = {
async getFilms({ commit }) {
const films = await this.$axios.$get("/api/films");
commit("setFilms", films);
try {
const films = await this.$axios.$get("/api/films");
commit("setFilms", films);
} catch (e) {
throw Error("API Error occurred.");
}
}
};