import { useLocalStore } from 'mobx-react-lite';
import { axios, Choerodon } from '@choerodon/boot';
export default function useStore() {
  return useLocalStore(function () {
    return {
      defaultImage: '',
      axiosGetDefaultImage: function axiosGetDefaultImage() {
        return axios.get('/devops/ci/default_image');
      },
      setDefaultImage: function setDefaultImage(data) {
        this.defaultImage = data;
      },

      get getDefaultImage() {
        return this.defaultImage;
      },

      currentAppService: {},

      get getCurrentAppService() {
        return this.currentAppService;
      },

      setCurrentAppService: function setCurrentAppService(data) {
        this.currentAppService = data;
      },
      searchAppServiceData: [],

      get getSearchAppServiceData() {
        return this.searchAppServiceData;
      },

      setSearchAppServiceData: function setSearchAppServiceData(data) {
        this.searchAppServiceData = data;
      },
      axiosCreatePipeline: function axiosCreatePipeline(data, projectId) {
        return axios.post("/devops/v1/projects/".concat(projectId, "/cicd_pipelines"), data);
      }
    };
  });
}