summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/clusters_list/store/mutations.js
blob: 5b46292851859481ad0b82faf28edaeffd2a7be2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as types from './mutation_types';

export default {
  [types.SET_LOADING_CLUSTERS](state, value) {
    state.loadingClusters = value;
  },
  [types.SET_LOADING_NODES](state, value) {
    state.loadingNodes = value;
  },
  [types.SET_CLUSTERS_DATA](state, { data, paginationInformation }) {
    Object.assign(state, {
      clusters: data.clusters,
      clustersPerPage: paginationInformation.perPage,
      hasAncestorClusters: data.has_ancestor_clusters,
      totalCulsters: paginationInformation.total,
    });
  },
  [types.SET_PAGE](state, value) {
    state.page = Number(value) || 1;
  },
};