refactor: fold cache revalidation into the event dispatcher
This commit is contained in:
@@ -3,7 +3,6 @@ import types from '../mutation-types';
|
||||
import LabelsAPI from '../../api/labels';
|
||||
import AnalyticsHelper from '../../helper/AnalyticsHelper';
|
||||
import { LABEL_EVENTS } from '../../helper/AnalyticsHelper/events';
|
||||
import { createCacheRevalidateAction } from '../utils/cacheRevalidate';
|
||||
|
||||
export const state = {
|
||||
records: [],
|
||||
@@ -33,12 +32,6 @@ export const getters = {
|
||||
};
|
||||
|
||||
export const actions = {
|
||||
revalidate: createCacheRevalidateAction({
|
||||
api: LabelsAPI,
|
||||
mutation: types.SET_LABELS,
|
||||
getData: response => response.data.payload,
|
||||
}),
|
||||
|
||||
get: async function getLabels({ commit }) {
|
||||
commit(types.SET_LABEL_UI_FLAG, { isFetching: true });
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user