"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getORecommandProgress = exports.getKrRecommandProgress = void 0;

var _axios = _interopRequireDefault(require("axios"));

var _BSGlobal$tenantInfo, _BSGlobal$loginUserIn;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var tenantId = BSGlobal && ((_BSGlobal$tenantInfo = BSGlobal.tenantInfo) === null || _BSGlobal$tenantInfo === void 0 ? void 0 : _BSGlobal$tenantInfo.Id) || 0;
var userId = BSGlobal && ((_BSGlobal$loginUserIn = BSGlobal.loginUserInfo) === null || _BSGlobal$loginUserIn === void 0 ? void 0 : _BSGlobal$loginUserIn.Id) || 0;

var requestDomain = function requestDomain() {
  if (!window.location.hostname.match(/dev/)) return "";
  return "".concat(location.protocol, "//www.tita.gift");
};

var getKrRecommandProgress = function getKrRecommandProgress(krId) {
  return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/kr/recommend/progress?krId=").concat(krId)).then(function (progress) {
    return progress.data;
  });
};

exports.getKrRecommandProgress = getKrRecommandProgress;

var getORecommandProgress = function getORecommandProgress(workId) {
  return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/recommend/progress?workId=").concat(workId)).then(function (progress) {
    return progress.data;
  });
};

exports.getORecommandProgress = getORecommandProgress;