import { DataManager } from "../../tw/manager/DataManager";
import { NetManager } from "../../tw/manager/NetManager";
import wait from "../../new_tc/wait";


const getCustomOrderStatus = (callback: Function): void => {
    NetManager.ins.getCustomOrderStatus(callback, DataManager.ins.doJoinData.orderId, () => {
        return DataManager.ins.getCustomOrderStatusData.code == 'C000000001';
    });
}

export default (callback, result) => {
    NetManager.ins.questionSubmit((success) => {
        if (success) {
            wait(500).then(() => {
                getCustomOrderStatus(callback)
            });
        } else {
            callback();
        }
    },
        DataManager.ins.doJoinData.orderId,
        JSON.stringify(result));
}