fix:handle error
This commit is contained in:
parent
5517c3dacb
commit
c51b8c7ff9
|
|
@ -28,6 +28,7 @@ import ReactSelect from "react-select";
|
|||
import makeAnimated from "react-select/animated";
|
||||
import { getAllUserLevels } from "@/services/user-levels/user-levels-service";
|
||||
import { listUserRole } from "@/services/master-user-role";
|
||||
import { getUnixTimestamp } from "@/utils/global";
|
||||
|
||||
const userSchema = z.object({
|
||||
id: z.number(),
|
||||
|
|
@ -195,7 +196,10 @@ export default function FormMasterUser() {
|
|||
|
||||
const fetchUserLevel = async () => {
|
||||
loading();
|
||||
const res = await getAllUserLevels();
|
||||
const res = await getAllUserLevels({
|
||||
limt: 200,
|
||||
timeStamp: getUnixTimestamp(),
|
||||
});
|
||||
close();
|
||||
if (res?.data?.data) {
|
||||
setupParent(res?.data?.data, "level");
|
||||
|
|
@ -230,6 +234,15 @@ export default function FormMasterUser() {
|
|||
}
|
||||
};
|
||||
|
||||
const [hasMounted, setHasMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setHasMounted(true);
|
||||
}, []);
|
||||
|
||||
// Render
|
||||
if (!hasMounted) return null;
|
||||
|
||||
return (
|
||||
<div className="mx-5 my-5 overflow-y-auto">
|
||||
<form method="POST" onSubmit={handleSubmit(onSubmit)}>
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export default function HeaderNews() {
|
|||
Hot Topik
|
||||
</p>
|
||||
<ScrollShadow hideScrollBar className="h-[29vh] lg:h-[400px] ">
|
||||
{hotNews.length > 0 ? (
|
||||
{hotNews?.length > 0 ? (
|
||||
hotNews.map((data: any, index: number) => (
|
||||
<div
|
||||
className="text-xs text-left m-2 p-2 dark:bg-[#1E1616] bg-white rounded-md flex flex-row gap-2"
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export default function NewsTicker() {
|
|||
<span className="mr-2"></span> BREAKING NEWS
|
||||
<div className="absolute right-0 top-0 h-full w-4 bg-[#bb3523] transform translate-x-full clipPath-triangle"></div>
|
||||
</div>
|
||||
{article.length > 0 ? (
|
||||
{article?.length > 0 ? (
|
||||
<div
|
||||
className={`w-full px-5 py-1 flex flex-col justify-center gap-1 transition-transform duration-300 ${
|
||||
animate ? "opacity-0 translate-y-5" : "opacity-100 translate-y-0"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export async function getAllUserLevels(data?: any) {
|
|||
`user-levels?limit=${data?.limit || ""}&levelNumber=${
|
||||
data?.levelNumber || ""
|
||||
}&name=${data?.search || ""}&page=${data?.page || "1"}&timeStamp=${
|
||||
data.timeStamp || ""
|
||||
data?.timeStamp || ""
|
||||
}`
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue