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