index.ts 503 Bytes
import { defHttp } from '/@/utils/http/axios';
import { RuleChainType } from '/@/views/rule/designer/types/ruleNode';

enum Api {
  SAVE = '/ruleChain/metadata',
}

export const getRuleChainData = (id: string) => {
  return defHttp.get<RuleChainType>(
    {
      url: `/ruleChain/${id}/metadata`,
    },
    { joinPrefix: false }
  );
};

export const saveRuleChainData = (data: RuleChainType) => {
  return defHttp.post(
    {
      url: Api.SAVE,
      data,
    },
    { joinPrefix: false }
  );
};