Commit 3995f8a6 authored by Tim Zallmann's avatar Tim Zallmann

Refetching Labels after 1 was created

parent 2395b4e9
...@@ -20,8 +20,8 @@ export const receiveLabelsFailure = ({ commit }) => { ...@@ -20,8 +20,8 @@ export const receiveLabelsFailure = ({ commit }) => {
message: __('Error fetching labels.'), message: __('Error fetching labels.'),
}); });
}; };
export const fetchLabels = ({ state, dispatch }) => { export const fetchLabels = ({ state, dispatch }, enforce) => {
if (state.labelsFetched) { if (!enforce && state.labelsFetched) {
return Promise.resolve(); return Promise.resolve();
} }
...@@ -50,6 +50,7 @@ export const createLabel = ({ state, dispatch }, label) => { ...@@ -50,6 +50,7 @@ export const createLabel = ({ state, dispatch }, label) => {
}) })
.then(({ data }) => { .then(({ data }) => {
if (data.id) { if (data.id) {
dispatch('fetchLabels', true);
dispatch('receiveCreateLabelSuccess'); dispatch('receiveCreateLabelSuccess');
dispatch('toggleDropdownContentsCreateView'); dispatch('toggleDropdownContentsCreateView');
} else { } else {
......
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