Fix experience bugs (#9)
This commit is contained in:
1 parent
c300500135
commit
b35d5a926a
260 files changed
+36865
-16290
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { httpClient } from './common';
|
||||
import { ICredential, ICredentialDetailResponse, ICredentialListResponse } from '@/models';
|
||||
|
||||
export interface ICredentialQuery {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
ordering?: string;
|
||||
user_id?: string;
|
||||
application_id?: string;
|
||||
}
|
||||
|
||||
class CredentialOperator {
|
||||
key = 'credentials';
|
||||
|
||||
async getAll(query: ICredentialQuery): Promise<AxiosResponse<ICredentialListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/`, {
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
async get(id: string): Promise<AxiosResponse<ICredentialDetailResponse>> {
|
||||
return await httpClient.get(`/${this.key}/${id}`);
|
||||
}
|
||||
|
||||
async create(data: ICredential): Promise<AxiosResponse<ICredentialDetailResponse>> {
|
||||
return await httpClient.post(`/${this.key}/`, data);
|
||||
}
|
||||
|
||||
async delete(id: string): Promise<AxiosResponse<null>> {
|
||||
return await httpClient.delete(`/${this.key}/${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
export const credentialOperator = new CredentialOperator();
|
||||
@@ -10,3 +10,4 @@ export * from './distribution';
|
||||
export * from './chatdoc';
|
||||
export * from './auth';
|
||||
export * from './service';
|
||||
export * from './credential';
|
||||
Reference in new issue
Block a user