import { useLocalStore } from 'mobx-react-lite';
import { axios } from '@choerodon/boot';
import map from 'lodash/map';
import { handlePromptError } from "../../../utils";
export default function useStore() {
  return useLocalStore(function () {
    return {
      checkChart: function checkChart(organizationId, data) {
        return axios.post("/devops/v1/organizations/".concat(organizationId, "/organization_config/check_chart"), JSON.stringify(data));
      },
      checkHarbor: function checkHarbor(organizationId, postData) {
        var url = '';
        map(postData, function (value, key) {
          value && (url = "".concat(url, "&").concat(key, "=").concat(value));
        });
        return axios.get("/devops/v1/organizations/".concat(organizationId, "/organization_config/check_harbor?").concat(url.substr(1)));
      }
    };
  });
}