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