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