update agent
This commit is contained in:
parent
1614997b52
commit
daf0c5d20c
|
|
@ -86,7 +86,7 @@ export default function Agent() {
|
|||
<h3 className="text-lg text-gray-900 text-center">{agent.name}</h3>
|
||||
|
||||
<p className="text-sm text-gray-600 text-center mt-1">
|
||||
{agent.job_title}
|
||||
{agent.job_title} Kelapa Gading
|
||||
</p>
|
||||
</motion.div>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import axios from "axios";
|
||||
|
||||
// Mengambil base URL dari environment variable, default ke API production
|
||||
const baseURL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://jaecookelapagading.com/api";
|
||||
const clientKey = process.env.NEXT_PUBLIC_CLIENT_KEY || "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640";
|
||||
const baseURL =
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL || "https://jaecookelapagading.com/api";
|
||||
const clientKey =
|
||||
process.env.NEXT_PUBLIC_CLIENT_KEY || "9f83220f-88d7-433f-98cc-fc5ef5a16ab9";
|
||||
|
||||
const axiosBaseInstance = axios.create({
|
||||
baseURL,
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ import { postSignIn } from "../master-user";
|
|||
import Cookies from "js-cookie";
|
||||
|
||||
// Mengambil base URL dari environment variable, default ke API production
|
||||
const baseURL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://jaecookelapagading.com/api";
|
||||
const clientKey = process.env.NEXT_PUBLIC_CLIENT_KEY || "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640";
|
||||
const baseURL =
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL || "https://jaecookelapagading.com/api";
|
||||
const clientKey =
|
||||
process.env.NEXT_PUBLIC_CLIENT_KEY || "9f83220f-88d7-433f-98cc-fc5ef5a16ab9";
|
||||
|
||||
const refreshToken = Cookies.get("refresh_token");
|
||||
|
||||
|
|
@ -30,7 +32,7 @@ axiosInterceptorInstance.interceptors.request.use(
|
|||
},
|
||||
(error) => {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Response interceptor
|
||||
|
|
@ -68,7 +70,7 @@ axiosInterceptorInstance.interceptors.response.use(
|
|||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
export default axiosInterceptorInstance;
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import axiosBaseInstance from "./axios-base-instance";
|
|||
|
||||
const defaultHeaders = {
|
||||
"Content-Type": "application/json",
|
||||
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640"
|
||||
"X-Client-Key": "9f83220f-88d7-433f-98cc-fc5ef5a16ab9",
|
||||
};
|
||||
|
||||
export async function httpGet(pathUrl: any, headers?: any) {
|
||||
console.log("X-HEADERS : ", defaultHeaders)
|
||||
console.log("X-HEADERS : ", defaultHeaders);
|
||||
const mergedHeaders = {
|
||||
...defaultHeaders,
|
||||
...headers,
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ import { getCsrfToken } from "../master-user";
|
|||
|
||||
const defaultHeaders = {
|
||||
"Content-Type": "application/json",
|
||||
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640"
|
||||
"X-Client-Key": "9f83220f-88d7-433f-98cc-fc5ef5a16ab9",
|
||||
};
|
||||
|
||||
export async function httpGetInterceptor(pathUrl: any) {
|
||||
console.log("X-HEADERS : ", defaultHeaders)
|
||||
console.log("X-HEADERS : ", defaultHeaders);
|
||||
const response = await axiosInterceptorInstance
|
||||
.get(pathUrl, { headers: defaultHeaders })
|
||||
.catch((error) => error.response);
|
||||
|
|
@ -35,7 +35,11 @@ export async function httpGetInterceptor(pathUrl: any) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function httpPostInterceptor(pathUrl: any, data: any, headers?: any) {
|
||||
export async function httpPostInterceptor(
|
||||
pathUrl: any,
|
||||
data: any,
|
||||
headers?: any,
|
||||
) {
|
||||
const resCsrf = await getCsrfToken();
|
||||
const csrfToken = resCsrf?.data?.csrf_token;
|
||||
|
||||
|
|
@ -67,7 +71,11 @@ export async function httpPostInterceptor(pathUrl: any, data: any, headers?: any
|
|||
}
|
||||
}
|
||||
|
||||
export async function httpPutInterceptor(pathUrl: any, data: any, headers?: any) {
|
||||
export async function httpPutInterceptor(
|
||||
pathUrl: any,
|
||||
data: any,
|
||||
headers?: any,
|
||||
) {
|
||||
const resCsrf = await getCsrfToken();
|
||||
const csrfToken = resCsrf?.data?.csrf_token;
|
||||
|
||||
|
|
@ -99,7 +107,7 @@ export async function httpPutInterceptor(pathUrl: any, data: any, headers?: any)
|
|||
}
|
||||
|
||||
export async function httpDeleteInterceptor(pathUrl: any, headers?: any) {
|
||||
const resCsrf = await getCsrfToken();
|
||||
const resCsrf = await getCsrfToken();
|
||||
const csrfToken = resCsrf?.data?.csrf_token;
|
||||
|
||||
const mergedHeaders = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue