const URL = "/one-api/mockup/receive-item-po/ReceiveItemPOAsset";

async function request(endpoint, params) {
    try {
        const resp = await axios.post(URL + endpoint, params);
        if (resp.status !== 200) {
            throw new Error(resp.statusText);
        }
        return resp.data;
    } catch (e) {
        return {
            status: "ERR",
            message: e.message
        }
    }
}

export async function getListSupplier(params) {
    return request("/getListSupplier", params);
}

export async function getListCabang(params) {
    return request("/getListCabang", params);
}

export async function getListGudang(params) {
    return request("/getListGudang", params);
}

export async function getListStaff(params) {
    return request("/getListStaff", params);
}

export async function searchOrderAsset(params) {
    return request("/searchOrderAsset", params);
}

export async function getListingROAsset(params) {
    return request("/getListingROAsset", params);
}

export async function generatePOItemReceive(params) {
    return request("/generatePOItemReceive", params);
}

export async function createReceiveOrder(params) {
    return request("/createReceiveOrder", params);
}

export async function editReceiveOrder(params) {
    return request("/editReceivedOrder", params);
}

export async function deleteReceiveOrder(params) {
    return request("/deleteReceiveOrder", params);
}

export async function confirmReceiveOrder(params) {
    return request("/confirmReceiveOrder", params);
}

export async function uploadAttachment(params) {
    return request("/uploadAttachment", params)
}

export async function getListAttachment(params) {
    return request("/getListAttachment", params)
}

export async function getDetailDataROAsset(params) {
    return request("/getDetailDataROAsset", params)
}
