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

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

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

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

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

export const deleteInvoiceSupp = async (body) =>
    PostData(url.urlDeleteInvoiceSupp, body)
        .then((res) => res)
        .catch((err) => null)
export const changeStatusInvoiceSupp = async (body) =>
    PostData(url.changeStatusInvoiceSupp, body)
        .then((res) => res)
        .catch((err) => null)
