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

export default {
  [types.SET_ENDPOINT](state, endpoint) {
    state.endpoint = endpoint;
  },
  [types.REQUEST_ARTIFACTS](state) {
    state.isLoading = true;
  },
  [types.RECEIVE_ARTIFACTS_SUCCESS](state, response) {
    state.hasError = false;
    state.isLoading = false;

    state.artifacts = response;
  },
  [types.RECEIVE_ARTIFACTS_ERROR](state) {
    state.isLoading = false;
    state.hasError = true;

    state.artifacts = [];
  },
};