import request from '@/utils/request';
import { CategoriesVO, CategoriesForm } from './types';

/** 查询全部精选分类 */
export const listCategories = () => {
  return request<CategoriesVO[]>({ url: '/system/applet/categories/list', method: 'get' });
};

/** 根据ID查询 */
export const getCategories = (id: string) => {
  return request<CategoriesVO>({ url: `/system/applet/categories/${id}`, method: 'get' });
};

/** 修改分类 */
export const editCategories = (data: CategoriesForm) => {
  return request({ url: '/system/applet/categories', method: 'put', data });
};
