Skip to content

Commit

Permalink
wip: frontend - category add
Browse files Browse the repository at this point in the history
  • Loading branch information
rkshaon committed Jun 22, 2024
1 parent ac45813 commit 4b7133d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/store/modules/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ const actions = {
},

async addCategory({ commit }, category) {
const response = await createCategoryForAdmin(category);
commit("addCategory", response.data);
try {
const response = await createCategoryForAdmin(category);
commit("addCategory", response.data);
return response.data;
} catch (error) {
console.error('Error adding category:', error);
throw error;
}
},

async deleteCategory({ commit }, id) {
Expand Down

0 comments on commit 4b7133d

Please sign in to comment.