import request from '/@/utils/request';
import type { TemplatePageReq } from './types';

/**
 * 分页查询模板
 * POST /admin/templateManagement/page
 */
export function fetchTemplatesPage(query?: TemplatePageReq) {
  if (query) {
    query.page = (query as any).current
  }
  return request({
    url: '/admin/templateManagement/page',
    method: 'post',
    data: query,
  });
}

/**
 * 删除模板
 * DELETE /admin/templateManagement/delete
 */
export function deleteTemplate(id?: string) {
  return request({
    url: '/admin/templateManagement/delete?id=' + id,
    method: 'delete'
  });
}