summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/stores/mutations/project.js
blob: 284b39a2c72a81278937f1a95d782af9dcebd580 (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
import * as types from '../mutation_types';

export default {
  [types.SET_CURRENT_PROJECT](state, currentProjectId) {
    Object.assign(state, {
      currentProjectId,
    });
  },
  [types.SET_PROJECT](state, { projectPath, project }) {
    // Add client side properties
    Object.assign(project, {
      tree: [],
      branches: {},
      mergeRequests: {},
      active: true,
    });

    Object.assign(state, {
      projects: Object.assign({}, state.projects, {
        [projectPath]: project,
      }),
    });
  },
};