rework to work with non forked version
This commit is contained in:
@@ -2,24 +2,24 @@ import { BaseClient } from "@dpu/shared";
|
||||
import { printNetworkError } from "@dpu/shared/dist/logger.js";
|
||||
|
||||
export class TidalClient extends BaseClient {
|
||||
async get<T>(endpoint: string): Promise<T> {
|
||||
try {
|
||||
const response = await this.getAxios().get<T>(`/${endpoint}`);
|
||||
async get<T>(endpoint: string): Promise<T> {
|
||||
try {
|
||||
const response = await this.getAxios().get<T>(`/${endpoint}`);
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
printNetworkError(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
printNetworkError(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async post<T>(endpoint: string, data: unknown): Promise<T> {
|
||||
try {
|
||||
const response = await this.getAxios().post<T>(`/${endpoint}`, data);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
printNetworkError(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
async put<T>(endpoint: string, data: unknown): Promise<T> {
|
||||
try {
|
||||
const response = await this.getAxios().put<T>(`/${endpoint}`, data);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
printNetworkError(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user