All files / app/assets/javascripts/reports/codequality_report/store mutations.js

100% Statements 15/15
100% Branches 2/2
100% Functions 4/4
100% Lines 15/15

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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        139x 139x 139x 139x     139x     4x 4x 4x 4x 4x 4x     142x 142x 142x 142x      
import * as types from './mutation_types';
 
export default {
  [types.SET_PATHS](state, paths) {
    state.baseBlobPath = paths.baseBlobPath;
    state.headBlobPath = paths.headBlobPath;
    state.reportsPath = paths.reportsPath;
    state.helpPath = paths.helpPath;
  },
  [types.REQUEST_REPORTS](state) {
    state.isLoading = true;
  },
  [types.RECEIVE_REPORTS_SUCCESS](state, data) {
    state.hasError = false;
    state.status = '';
    state.statusReason = '';
    state.isLoading = false;
    state.newIssues = data.newIssues;
    state.resolvedIssues = data.resolvedIssues;
  },
  [types.RECEIVE_REPORTS_ERROR](state, error) {
    state.isLoading = false;
    state.hasError = true;
    state.status = error?.status || '';
    state.statusReason = error?.response?.data?.status_reason;
  },
};