website refactor
This commit is contained in:
@@ -20,7 +20,7 @@ export class ApiClient {
|
||||
/**
|
||||
* Make HTTP request to API
|
||||
*/
|
||||
private async request<T>(method: string, path: string, body?: any, headers: Record<string, string> = {}): Promise<T> {
|
||||
private async request<T>(method: string, path: string, body?: unknown, headers: Record<string, string> = {}): Promise<T> {
|
||||
const url = `${this.baseUrl}${path}`;
|
||||
const controller = new AbortController();
|
||||
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
||||
@@ -64,17 +64,17 @@ export class ApiClient {
|
||||
}
|
||||
|
||||
// POST requests
|
||||
async post<T>(path: string, body: any, headers?: Record<string, string>): Promise<T> {
|
||||
async post<T>(path: string, body: unknown, headers?: Record<string, string>): Promise<T> {
|
||||
return this.request<T>('POST', path, body, headers);
|
||||
}
|
||||
|
||||
// PUT requests
|
||||
async put<T>(path: string, body: any, headers?: Record<string, string>): Promise<T> {
|
||||
async put<T>(path: string, body: unknown, headers?: Record<string, string>): Promise<T> {
|
||||
return this.request<T>('PUT', path, body, headers);
|
||||
}
|
||||
|
||||
// PATCH requests
|
||||
async patch<T>(path: string, body: any, headers?: Record<string, string>): Promise<T> {
|
||||
async patch<T>(path: string, body: unknown, headers?: Record<string, string>): Promise<T> {
|
||||
return this.request<T>('PATCH', path, body, headers);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user