import axios from 'axios'; import qs from 'query-string'; export interface Pageable { pageNumber: number; pageSize: number; sort: { sorted: boolean; unsorted: boolean; empty: boolean; }; offset: number; paged: boolean; } export interface ListParams { page: number; size: number; } export interface ListRes { content: Record[]; totalPages: number; totalElements: number; size: number; number: number; pageable: Pageable; } export function queryList( url: string, params: ListParams | undefined ) { if (params) { return axios.get>(url, { params, paramsSerializer: (obj) => { return qs.stringify(obj); }, }); }; return axios.get>(url); }