import request from "@/utils/request";

export function index(params,isLoading = false) {
  return request({
    method: "get",
    url: "/api/admin/custom-form/index",
    params,
    isLoading
  })
}

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

export function save(data) {
  return request({
    method: "post",
    url: "/api/admin/custom-form/save",
    data
  })
}

export function destroy(params) {
  return request({
    method: "get",
    url: "/api/admin/custom-form/destroy",
    params
  })
}

export function update(params) {
  return request({
    method: "get",
    url: "/api/admin/custom-form/update-table",
    params,
    isLoading:false
  })
}

export function realTableIndex() {
  return request({
    method: "get",
    url: '/api/admin/custom-form/real-table-index'
  })
}

export function realTableShow(params) {
  return request({
    method: "get",
    url: '/api/admin/custom-form/real-table-show',
    params
  })
}

export function relationDestroy(params) {
  return request({
    method: 'get',
    url: '/api/admin/custom-form/relation-destroy',
    params
  })
}

export function clone (params) {
  return request({
    method: 'get',
    url: '/api/admin/custom-form/clone-table',
    params
  })
}
