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

export const getListPageStatic = async (body) =>
  PostData(url.urlGetListPageStatic, body)
    .then((res) => res)
    .catch((err) => null);

export const createPageStatic = async (body) =>
  PostData(url.urlCreatePageStatic, body)
    .then((res) => res)
    .catch((err) => null);

export const updatePageStatic = async (body) =>
  PostData(url.urlUpdatePageStatic, body)
    .then((res) => res)
    .catch((err) => null);

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

export const deletePageStatic = async (body) =>
  PostData(url.urlDeletePageStatic, body)
    .then((res) => res)
    .catch((err) => null);

export const getListActionByPageStatic = async (id, body) =>
  GetURL(`${url.urlListActionByPageStatic}/${id}`, body)
    .then((res) => res)
    .catch((err) => null);
export const changeStatusPageStatic = async (body) =>
  PostData(url.changeStatusPageStatic, body)
    .then((res) => res)
    .catch((err) => null);