diff --git a/components/form/form-master-user.tsx b/components/form/form-master-user.tsx index 4f78b44..a9f319e 100644 --- a/components/form/form-master-user.tsx +++ b/components/form/form-master-user.tsx @@ -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 (