const URL = "/one-api/mockup/masterdata/accounting/";

export async function getListing(params) {
    try {
        var resp = await axios.post(URL + 'mdperiode/listperiode', params);
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            };
        }
        let data = resp.data;
        return data;
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        };
    }
}

export async function p_delete(params) {
    try {
        var resp = await axios.post(URL + 'mdperiode/deleteperiode', params);
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: error.message
            };            
        }
        let data = resp.data;
        return data;
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        };
    }
}

export async function p_add(params) {
    try {
        var resp = await axios.post(URL + 'mdperiode/addperiode', params);
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: error.message
            };
        }
        let data = resp.data;
        return data;
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        };
    }
}

export async function p_edit(params) {
    try {
        var resp = await axios.post(URL + 'mdperiode/editperiode', params);
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: error.message
            };
        }
        let data = resp.data;
        return data;
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        };
    }
}