import request from "@/utils/request";

export function index (params,isLoading=true) {
  return request({
    method: "get",
    url: "/api/admin/category/index",
    params,
    isLoading
  })
}

export function store (data,isLoading=true) {
  return request({
    method: "post",
    url: "/api/admin/category/store",
    data,
    isLoading
  })
}

export function show (params,isLoading=true) {
  return request({
    method: "get",
    url: "/api/admin/category/show",
    params,
    isLoading
  })
}

export function save (data,isLoading=true) {
  return request({
    method: "post",
    url: "/api/admin/category/save",
    data,
    isLoading
  })
}

export function destroy (data,isLoading=true) {
  return request({
    method: "post",
    url: "/api/admin/category/delete",
    data,
    isLoading
  })
}

export function  categoryYears(params,isLoading=true) {
  return request({
    method: "get",
    url: "/api/admin/get-years",
    params,
    isLoading
  })
}

export function  categoryTypes(params,isLoading=true) {
  return request({
    method: "get",
    url: "/api/admin/get-category-types",
    params,
    isLoading
  })
}
