MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / requestUseRedeem

Function requestUseRedeem

panel/src/app/service/exchange_service.ts:85–114  ·  view source on GitHub ↗
(
  panelId: string,
  registerCode: string,
  productId: string | number,
  daemonId: string,
  code: string,
  isDelete?: boolean
)

Source from the content-addressed store, hash-verified

83);
84
85export async function requestUseRedeem(
86 panelId: string,
87 registerCode: string,
88 productId: string | number,
89 daemonId: string,
90 code: string,
91 isDelete?: boolean
92) {
93 const { data: responseData } = await axios.post<IRedeemResponseProtocol<IBusinessProductInfo>>(
94 `${REDEEM_PLATFORM_ADDR}/api/iframe_instances/use_redeem`,
95 {
96 panelId,
97 registerCode,
98 productId,
99 daemonId,
100 code,
101 isDelete
102 },
103 {
104 headers: {
105 "X-Panel-Id": panelId,
106 "X-Register-Code": registerCode
107 }
108 }
109 );
110 if (responseData.code !== 200) {
111 throw new Error(responseData.message);
112 }
113 return responseData.data;
114}
115
116function formatInstanceData(instance: IAdvancedInstanceInfo): IInstanceInfoProtocol {
117 let ports: string[] = instance.docker?.ports ?? [];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected