Commit 2395b4e9 authored by Tim Zallmann's avatar Tim Zallmann

Added return promise resolve

parent 2939b8b8
......@@ -21,15 +21,17 @@ export const receiveLabelsFailure = ({ commit }) => {
});
};
export const fetchLabels = ({ state, dispatch }) => {
if (!state.labelsFetched) {
dispatch('requestLabels');
return axios
.get(state.labelsFetchPath)
.then(({ data }) => {
dispatch('receiveLabelsSuccess', data);
})
.catch(() => dispatch('receiveLabelsFailure'));
if (state.labelsFetched) {
return Promise.resolve();
}
dispatch('requestLabels');
return axios
.get(state.labelsFetchPath)
.then(({ data }) => {
dispatch('receiveLabelsSuccess', data);
})
.catch(() => dispatch('receiveLabelsFailure'));
};
export const requestCreateLabel = ({ commit }) => commit(types.REQUEST_CREATE_LABEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment