refactor: fold cache revalidation into the event dispatcher
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user