summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/gitlab_pages/domains/store/mutations.js
blob: b19cbb70c4d72a544a90f04f5b08bf0ff3c5fad3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import * as types from './mutation_types';

export default {
  [types.SET_DOMAIN_ENDPOINT](state, endpoint) {
    state.domainEndpoint = endpoint;
  },

  [types.SET_DOMAIN_NAME](state, name) {
    state.domainName = name;
  },

  [types.REQUEST_DOMAIN](state) {
    state.isLoading = true;
  },

  [types.RECEIVE_DOMAIN_SUCCESS](state, domain) {
    state.isLoading = false;
    state.hasError = false;
    state.domain = domain;

    console.log(domain);
  },

  [types.RECEIVE_DOMAIN_ERROR](state) {
    state.isLoading = false;
    state.hasError = true;
    state.domain = {};
  },
};