import { eCollectionType } from "@/views/Collection/PassMaker/types";
import { GO_URLS } from "cqk-sy-ui";
import { $ajax } from ".";
import { URLS } from "./URL";

/**
 * @description: 重新转账
 * @param transferType 转账类型
 * @param content 数据
 * @returns
 */
export async function reTransfer(
  transferType: eCollectionType,
  content: {
    to?: string;
    batch_num?: string;
    id?: number;
  }
) {
  if (transferType === "copyright") {
    const res = await $ajax({
      type: "post",
      url: GO_URLS.reTransfer,
      params: {
        id: content.id,
      },
    });
    return res;
  } else if (transferType === "album") {
    const res = await $ajax({
      type: "post",
      url: URLS.transferBatch,
      params: {
        batch_num: content.batch_num,
        to: content.to,
      },
    });
    return res;
  }
}
