feat: add shared
ci-front / build (push) Successful in 1m58s

This commit is contained in:
2026-04-03 20:00:51 +03:00
parent add00401de
commit f073756e92
11 changed files with 1461 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
import { apiClient } from "./axios.instance";
import type { AxiosResponse } from "axios";
export interface ApiResponse<T = any> {
data: T;
message: string;
success: boolean;
}
class ApiService {
async get<T>(url: string, config?: any): Promise<T> {
const response: AxiosResponse<T> = await apiClient.get(url, config);
return response.data;
}
async post<T, D = any>(url: string, data?: D, config?: any): Promise<T> {
const response: AxiosResponse<T> = await apiClient.post(url, data, config);
return response.data;
}
async put<T, D = any>(url: string, data?: D, config?: any): Promise<T> {
const response: AxiosResponse<T> = await apiClient.put(url, data, config);
return response.data;
}
async patch<T, D = any>(url: string, data?: D, config?: any): Promise<T> {
const response: AxiosResponse<T> = await apiClient.patch(url, data, config);
return response.data;
}
async delete<T>(url: string, config?: any): Promise<T> {
const response: AxiosResponse<T> = await apiClient.delete(url, config);
return response.data;
}
}
export const apiService = new ApiService();