update pagination
This commit is contained in:
1 parent
89461c8b1a
commit
f3fb5ba6fd
12 files changed
+155
-30
No files matched your search
@@ -1,12 +1,20 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { decamelizeKeys } from 'humps';
|
||||
import { httpClient } from '../instance';
|
||||
import { IService, IServiceDetailResponse, IServiceListResponse } from './models';
|
||||
|
||||
export interface IServiceQuery {
|
||||
limit: number;
|
||||
offset: number;
|
||||
}
|
||||
|
||||
class ServiceOperator {
|
||||
key = 'services';
|
||||
|
||||
async getAll(): Promise<AxiosResponse<IServiceListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/`);
|
||||
async getAll(query: IServiceQuery): Promise<AxiosResponse<IServiceListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/`, {
|
||||
params: decamelizeKeys(query)
|
||||
});
|
||||
}
|
||||
|
||||
async get(id: string): Promise<AxiosResponse<IServiceDetailResponse>> {
|
||||
|
||||
Reference in new issue
Block a user