import req from 'editorReq'; import { useQuery } from 'react-query'; import { ICategory, IResponce, TResponce1 } from 'src/type'; import { API_CMS_ADMIN } from './config'; const ARTICLE_CATEGORY_GET_ALL = `${API_CMS_ADMIN}/cate/list/10000/1/created_at/DESC/complex`; export async function getAll() { return req({ url: ARTICLE_CATEGORY_GET_ALL, method: 'PUT', data: {} }) as Promise< TResponce1 >; } export const useArticleCategory = () => { const { data, ...rest } = useQuery(ARTICLE_CATEGORY_GET_ALL, getAll); return { data, ...rest, }; }; export interface IArticleCategorys { firstPage: boolean; hasNextPage: boolean; hasPrePage: boolean; items: IArticleCategory[]; lastPage: boolean; limit: number; nextPage: number; page: number; prePage: number; totalCount: number; totalPages: number; } export interface IArticleCategory extends ICategory { arrchild: string; arrpid: string; child: number; created_at: string; deleted_at: null | string; display: number; image: string; model_ids: string; sort: number; system: string; tree: string; updated_at: string; _id: string; }