debian-mirror-gitlab/app/assets/javascripts/search/store/mutations.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.4 KiB
JavaScript
Raw Normal View History

2021-01-29 00:20:46 +05:30
import * as types from './mutation_types';
export default {
[types.REQUEST_GROUPS](state) {
state.fetchingGroups = true;
},
[types.RECEIVE_GROUPS_SUCCESS](state, data) {
state.fetchingGroups = false;
state.groups = data;
},
[types.RECEIVE_GROUPS_ERROR](state) {
state.fetchingGroups = false;
state.groups = [];
},
2021-02-22 17:27:13 +05:30
[types.REQUEST_PROJECTS](state) {
state.fetchingProjects = true;
},
[types.RECEIVE_PROJECTS_SUCCESS](state, data) {
state.fetchingProjects = false;
state.projects = data;
},
[types.RECEIVE_PROJECTS_ERROR](state) {
state.fetchingProjects = false;
state.projects = [];
},
2021-01-29 00:20:46 +05:30
[types.SET_QUERY](state, { key, value }) {
2023-05-27 22:25:52 +05:30
state.query = { ...state.query, [key]: value };
2021-01-29 00:20:46 +05:30
},
2021-12-11 22:18:48 +05:30
[types.SET_SIDEBAR_DIRTY](state, value) {
state.sidebarDirty = value;
},
2021-09-30 23:02:18 +05:30
[types.LOAD_FREQUENT_ITEMS](state, { key, data }) {
state.frequentItems[key] = data;
},
2023-01-13 00:05:48 +05:30
[types.RECEIVE_NAVIGATION_COUNT](state, { key, count }) {
const item = { ...state.navigation[key], count };
state.navigation = { ...state.navigation, [key]: item };
},
2023-04-23 21:23:45 +05:30
[types.REQUEST_AGGREGATIONS](state) {
state.aggregations = { fetching: true, error: false, data: [] };
},
[types.RECEIVE_AGGREGATIONS_SUCCESS](state, data) {
state.aggregations = { fetching: false, error: false, data: [...data] };
},
[types.RECEIVE_AGGREGATIONS_ERROR](state) {
state.aggregations = { fetching: false, error: true, data: [] };
},
2021-01-29 00:20:46 +05:30
};