refactor: fold cache revalidation into the event dispatcher

This commit is contained in:
Shivam Mishra
2026-06-10 12:59:26 +05:30
parent 343b25842a
commit 3e65534e68
11 changed files with 136 additions and 184 deletions
@@ -1,7 +1,6 @@
import * as MutationHelpers from 'shared/helpers/vuex/mutationHelpers';
import * as types from '../mutation-types';
import AgentAPI from '../../api/agents';
import { createCacheRevalidateAction } from '../utils/cacheRevalidate';
export const state = {
records: [],
@@ -52,10 +51,6 @@ export const actions = {
commit(types.default.SET_AGENT_FETCHING_STATUS, false);
}
},
revalidate: createCacheRevalidateAction({
api: AgentAPI,
mutation: types.default.SET_AGENTS,
}),
create: async ({ commit }, agentInfo) => {
commit(types.default.SET_AGENT_CREATING_STATUS, true);
try {