summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/whats_new/store/actions.js
blob: a84dfb399d80ae65a4da84a097cbc7d8a4e45504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as types from './mutation_types';
import axios from '~/lib/utils/axios_utils';

export default {
  closeDrawer({ commit }) {
    commit(types.CLOSE_DRAWER);
  },
  openDrawer({ commit }, storageKey) {
    commit(types.OPEN_DRAWER);

    if (storageKey) {
      localStorage.setItem(storageKey, JSON.stringify(false));
    }
  },
  fetchItems({ commit }) {
    return axios.get('/-/whats_new').then(({ data }) => {
      commit(types.SET_FEATURES, data);
    });
  },
};