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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -77,7 +77,6 @@ export function ComponentNotifiaksi_CardView({
|
||||
onClick={async () => {
|
||||
try {
|
||||
setVisible(true);
|
||||
console.log("data", data);
|
||||
|
||||
// JOB
|
||||
if (data?.kategoriApp === "JOB") {
|
||||
|
||||
Reference in New Issue
Block a user