feat: Ability to edit saved folders (#7236)
* feat: Ability to edit saved filters Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
@@ -49,6 +49,18 @@ export const actions = {
|
||||
commit(types.SET_CUSTOM_VIEW_UI_FLAG, { isCreating: false });
|
||||
}
|
||||
},
|
||||
update: async function updateCustomViews({ commit }, obj) {
|
||||
commit(types.SET_CUSTOM_VIEW_UI_FLAG, { isCreating: true });
|
||||
try {
|
||||
const response = await CustomViewsAPI.update(obj.id, obj);
|
||||
commit(types.UPDATE_CUSTOM_VIEW, response.data);
|
||||
} catch (error) {
|
||||
const errorMessage = error?.response?.data?.message;
|
||||
throw new Error(errorMessage);
|
||||
} finally {
|
||||
commit(types.SET_CUSTOM_VIEW_UI_FLAG, { isCreating: false });
|
||||
}
|
||||
},
|
||||
delete: async ({ commit }, { id, filterType }) => {
|
||||
commit(types.SET_CUSTOM_VIEW_UI_FLAG, { isDeleting: true });
|
||||
try {
|
||||
@@ -72,6 +84,7 @@ export const mutations = {
|
||||
|
||||
[types.ADD_CUSTOM_VIEW]: MutationHelpers.create,
|
||||
[types.SET_CUSTOM_VIEW]: MutationHelpers.set,
|
||||
[types.UPDATE_CUSTOM_VIEW]: MutationHelpers.update,
|
||||
[types.DELETE_CUSTOM_VIEW]: MutationHelpers.destroy,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user