/* eslint-disable handle-callback-err */
import { PostData, GetURL } from '../helpers'
import url from '../url'

export const getListPackageFunction = async (body) =>
    PostData(url.urlGetListPackageFunction, body)
        .then((res) => res)
        .catch((err) => null)

export const createPackageFunction = async (body) =>
    PostData(url.urlCreatePackageFunction, body)
        .then((res) => res)
        .catch((err) => null)

export const updatePackageFunction = async (body) =>
    PostData(url.urlUpdatePackageFunction, body)
        .then((res) => res)
        .catch((err) => null)

export const detailPackageFunction = async (id, body) =>
    GetURL(`${url.urlDetailPackageFunction}/${id}`, body)
        .then((res) => res)
        .catch((err) => null)

export const deletePackageFunction = async (body) =>
    PostData(url.urlDeletePackageFunction, body)
        .then((res) => res)
        .catch((err) => null)
export const changeStatusPackageFunction = async (body) =>
    PostData(url.changeStatusPackageFunction, body)
        .then((res) => res)
        .catch((err) => null)

export const getListPriceProduct = async (body) =>
    PostData(url.urlGetListPriceProduct, body)
        .then((res) => res)
        .catch((err) => null)

export const createPriceProduct = async (body) =>
    PostData(url.urlCreatePriceProduct, body)
        .then((res) => res)
        .catch((err) => null)

export const updatePriceProduct = async (body) =>
    PostData(url.urlUpdatePriceProduct, body)
        .then((res) => res)
        .catch((err) => null)

export const detailPriceProduct = async (id, body) =>
    GetURL(`${url.urlDetailPriceProduct}/${id}`, body)
        .then((res) => res)
        .catch((err) => null)

export const deletePriceProduct = async (body) =>
    PostData(url.urlDeletePriceProduct, body)
        .then((res) => res)
        .catch((err) => null)
export const changeStatusPriceProduct = async (body) =>
    PostData(url.changeStatusPriceProduct, body)
        .then((res) => res)
        .catch((err) => null)

export const getListPackage = async (body) =>
    PostData(url.urlGetListPackage, body)
        .then((res) => res)
        .catch((err) => null)

export const createPackage = async (body) =>
    PostData(url.urlCreatePackage, body)
        .then((res) => res)
        .catch((err) => null)

export const updatePackage = async (body) =>
    PostData(url.urlUpdatePackage, body)
        .then((res) => res)
        .catch((err) => null)

export const detailPackage = async (id, body) =>
    GetURL(`${url.urlDetailPackage}/${id}`, body)
        .then((res) => res)
        .catch((err) => null)

export const deletePackage = async (body) =>
    PostData(url.urlDeletePackage, body)
        .then((res) => res)
        .catch((err) => null)
export const changeStatusPackage = async (body) =>
    PostData(url.changeStatusPackage, body)
        .then((res) => res)
        .catch((err) => null)

export const getListtPaymentCost = async (body) =>
    PostData(url.urlGetListPaymentCost, body)
        .then((res) => res)
        .catch((err) => null)

export const detailPaymentCost = async (id, body) =>
    GetURL(`${url.urlDetailPaymentCost}/${id}`, body)
        .then((res) => res)
        .catch((err) => null)

export const acceptPaymentCost = async (id, body) =>
    PostData(`${url.acceptPaymentCost}/${id}`, body)
        .then((res) => res)
        .catch((err) => null)
