fix: nested layout

deskripsi:
- fix use server pada nested layout
- penambahan pemanggilan api pada realtime provider
- fix tampilan table admin event pada username
This commit is contained in:
2025-05-23 14:20:05 +08:00
parent be2982a1cb
commit c202cc8ea0
5 changed files with 56 additions and 15 deletions

View File

@@ -112,3 +112,33 @@ const apiGetSeasonUserId = async () => {
throw error; // Re-throw the error to handle it in the calling function
}
};
export const apiNewGetUserIdByToken = async () => {
try {
const response = await fetch(`/api/user/id`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
});
// Check if the response is OK
if (!response.ok) {
const errorData = await response.json().catch(() => null);
console.error(
"Failed to get user id",
response.statusText,
errorData
);
throw new Error(errorData?.message || "Failed to get user id");
}
const data = await response.json();
return data;
} catch (error) {
console.error("Error get user id", error);
throw error; // Re-throw the error to handle it in the calling function
}
}

View File

@@ -262,7 +262,7 @@ export default function AdminEvent_ComponentTableReview() {
<td>
<Center c={AdminColor.white}>
<Box w={100}>
<Text>{e?.Author?.username}</Text>
<Text lineClamp={1}>{e?.Author?.username}</Text>
</Box>
</Center>
</td>

View File

@@ -77,7 +77,6 @@ export function ComponentNotifiaksi_CardView({
onClick={async () => {
try {
setVisible(true);
console.log("data", data);
// JOB
if (data?.kategoriApp === "JOB") {