update publications list
This commit is contained in:
1 parent
672b5559a2
commit
4cc866a4ce
8 files changed
+129
-17
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { DEFAULT_LIMIT } from '@/settings/article';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import httpClient from '../../instance';
|
||||
import { IArticle, IArticleDetailResponse, IArticleListResponse } from './types';
|
||||
@@ -5,7 +6,7 @@ import { IArticle, IArticleDetailResponse, IArticleListResponse } from './types'
|
||||
class ArticleService {
|
||||
key = 'articles';
|
||||
|
||||
async getAll(offset: number = 0, limit: number = 10): Promise<AxiosResponse<IArticleListResponse>> {
|
||||
async getAll(offset: number = 0, limit: number = DEFAULT_LIMIT): Promise<AxiosResponse<IArticleListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/?limit=${limit}&offset=${offset}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { DEFAULT_LIMIT } from '@/settings/article';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import httpClient from '../../instance';
|
||||
import { IPublication, IPublicationDetailResponse, IPublicationListResponse, IPublicationCreateRequest } from './types';
|
||||
@@ -5,8 +6,8 @@ import { IPublication, IPublicationDetailResponse, IPublicationListResponse, IPu
|
||||
class PublicationService {
|
||||
key = 'publications';
|
||||
|
||||
async getAll(): Promise<AxiosResponse<IPublicationListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/`);
|
||||
async getAll(offset: number = 0, limit: number = DEFAULT_LIMIT): Promise<AxiosResponse<IPublicationListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/?limit=${limit}&offset=${offset}`);
|
||||
}
|
||||
|
||||
async get(id: number): Promise<AxiosResponse<IPublicationDetailResponse>> {
|
||||
|
||||
Reference in new issue
Block a user