Fix init issue for site (#50)
This commit is contained in:
1 parent
beb85b8ebd
commit
223e14222d
6 files changed
+57
-31
No files matched your search
@@ -1,10 +1,9 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { httpClient } from './common';
|
||||
import { ISite, ISiteDetailResponse } from '@/models';
|
||||
import { ISite, ISiteDetailResponse, ISiteListResponse } from '@/models';
|
||||
|
||||
export interface ISiteQuery {
|
||||
user_id?: string;
|
||||
package_id?: string;
|
||||
origin?: string;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
}
|
||||
@@ -16,6 +15,12 @@ class SiteService {
|
||||
return await httpClient.post(`/${this.key}/initialize/`, data);
|
||||
}
|
||||
|
||||
async getAll(query: ISiteQuery): Promise<AxiosResponse<ISiteListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/`, {
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
async get(id: string): Promise<AxiosResponse<ISiteDetailResponse>> {
|
||||
return await httpClient.get(`/${this.key}/${id}`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user