finished paginition

This commit is contained in:
AceDataCloud committed 2021-09-19 21:05:25 +08:00
1 parent a05249329e
commit 57b44f1d28
7 files changed
+138 -16

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@ import { IArticle, IArticleDetailResponse, IArticleListResponse } from './types'
class ArticleService {
key = 'articles';
async getAll(): Promise<AxiosResponse<IArticleListResponse>> {
return await httpClient.get(`/${this.key}/`);
async getAll(offset: number = 0, limit: number = 10): Promise<AxiosResponse<IArticleListResponse>> {
return await httpClient.get(`/${this.key}/?limit=${limit}&offset=${offset}`);
}
async get(id: string | string[]): Promise<AxiosResponse<IArticleDetailResponse>> {