{"size": 504, "ext": "js", "max_stars_repo_path": "__modules/page-editor/js/state/modules/asset.js", "max_stars_repo_name": "pagieco/test", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "__modules/page-editor/js/state/modules/asset.js", "max_issues_repo_name": "pagieco/test", "max_issues_repo_issues_event_min_datetime": "2019-12-16T08:43:28.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T19:21:46.000Z", "max_forks_repo_path": "__modules/page-editor/js/state/modules/asset.js", "max_forks_repo_name": "pagieco/test", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 6, "max_forks_count": null, "avg_line_length": 16.2580645161, "max_line_length": 42, "alphanum_fraction": 0.5376984127}
import http from '../../services/http';

export const state = {
  assets: [],
};

export const getters = {
  assets(state) {
    return state.assets;
  },
};

export const mutations = {
  SET_ASSETS(state, assets) {
    state.assets = assets;
  },
};

export const actions = {
  fetchAssets({ commit }) {
    commit('SET_ASSETS', []);

    return http.get('/assets')
      .then(({ status, data }) => {
        if (status === 200) {
          commit('SET_ASSETS', data.data);
        }
      });
  },
};
