import { apiAxiosInstance } from "@/service"; export type ReprocessItemValues = { typeID: number; buy: number; buy_reprocess: number; sell: number; sell_reprocess: number; } export const reprocess = async (items: string, minerals: string, efficiency?: number): Promise => { if (!items || !minerals || (efficiency && (efficiency < 0 || efficiency > 1))) { return []; } const itemsJson = JSON.parse(items); const mineralsJson = JSON.parse(minerals); const sourceJson = { "ep_items": itemsJson, "ep_mat": mineralsJson }; const source = JSON.stringify(sourceJson); const response = await apiAxiosInstance.post('/reprocess', source, {params: {efficiency: efficiency ?? 0.55}}); return response.data; };