diff --git a/service/local-api-service.ts b/service/local-api-service.ts index f57b180..b129b00 100644 --- a/service/local-api-service.ts +++ b/service/local-api-service.ts @@ -1,16 +1,13 @@ /** * Service untuk memanggil API lokal (localhost:8800) * Menggunakan endpoint dari .env - * + * * Contoh penggunaan: * - Set NEXT_PUBLIC_API_BASE_URL=http://localhost:8800 di file .env.local * - Atau gunakan NEXT_PUBLIC_LOCAL_API_URL jika ingin endpoint terpisah */ -import { - httpGet, - httpPost, -} from "./http-config/http-base-services"; +import { httpGet, httpPost } from "./http-config/http-base-services"; import { httpGetInterceptor, @@ -26,7 +23,11 @@ export async function getDataFromLocal(endpoint: string, headers?: any) { return await httpGet(endpoint, headers); } -export async function postDataToLocal(endpoint: string, data: any, headers?: any) { +export async function postDataToLocal( + endpoint: string, + data: any, + headers?: any, +) { return await httpPost(endpoint, data, headers); } @@ -34,14 +35,22 @@ export async function postDataToLocal(endpoint: string, data: any, headers?: any // Menggunakan axios-interceptor-instance.ts dengan Bearer token export async function getDataWithAuth(endpoint: string, headers?: any) { - return await httpGetInterceptor(endpoint, headers); + return await httpGet(endpoint, headers); } -export async function postDataWithAuth(endpoint: string, data: any, headers?: any) { +export async function postDataWithAuth( + endpoint: string, + data: any, + headers?: any, +) { return await httpPostInterceptor(endpoint, data, headers); } -export async function updateDataWithAuth(endpoint: string, data: any, headers?: any) { +export async function updateDataWithAuth( + endpoint: string, + data: any, + headers?: any, +) { return await httpPutInterceptor(endpoint, data, headers); } @@ -71,4 +80,3 @@ export async function updateUser(id: string | number, data: any) { export async function deleteUser(id: string | number) { return await httpDeleteInterceptor(`/users/${id}`); } -