fix portofolio

deskripsi:
- fix server to API
This commit is contained in:
2025-02-10 17:12:03 +08:00
parent a7ad183f3e
commit 1c31943c95
8 changed files with 208 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
export { apiGetMasterBank };
export { apiGetMasterBank, apiGetMasterBidangBisnis };
const apiGetMasterBank = async () => {
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
@@ -12,8 +12,22 @@ const apiGetMasterBank = async () => {
Authorization: `Bearer ${token}`,
},
});
return await respone.json().catch(() => null);
};
const apiGetMasterBidangBisnis = async () => {
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
if (!token) return await token.json().catch(() => null);
const respone = await fetch(`/api/master/bidang-bisnis`, {
headers: {
"Content-Type": "application/json",
Accept: "application/json",
"Access-Control-Allow-Origin": "*",
Authorization: `Bearer ${token}`,
},
});
return await respone.json().catch(() => null);
};