This commit is contained in:
hanif salafi 2025-06-21 11:43:54 +07:00
commit d98836494e
3 changed files with 26 additions and 10 deletions

View File

@ -121,8 +121,9 @@ export default function FormImageDetail() {
const router = useRouter(); const router = useRouter();
const userId = getCookiesDecrypt("uie"); const userId = getCookiesDecrypt("uie");
const userLevelId = getCookiesDecrypt("ulie"); const userLevelId = getCookiesDecrypt("ulie");
const userLevelName = Cookies.get("state");
const roleId = getCookiesDecrypt("urie"); const roleId = getCookiesDecrypt("urie");
console.log("LALALALA", userLevelName);
const [modalOpen, setModalOpen] = useState(false); const [modalOpen, setModalOpen] = useState(false);
const { id } = useParams() as { id: string }; const { id } = useParams() as { id: string };
console.log(id); console.log(id);
@ -683,15 +684,21 @@ export default function FormImageDetail() {
"" ""
)} */} )} */}
{(detail?.isPublish == false && detail.isPublishOnPolda == true) || (detail?.isPublish == false && detail?.isInternationalMedia == true && Number(detail?.statusId) == 2) ? ( {(detail?.isPublish == false &&
detail.isPublishOnPolda == true) ||
(detail?.isPublish == false &&
detail?.isInternationalMedia == true &&
Number(detail?.statusId) == 2) ? (
<div className="flex flex-col gap-2 p-3"> <div className="flex flex-col gap-2 p-3">
<Button {userLevelName?.includes("MABES") && (
onClick={() => publishToMabes()} <Button
type="button" onClick={() => publishToMabes()}
color="primary" type="button"
> color="primary"
<Icon icon="fa:check" className="mr-3" /> Publish >
</Button> <Icon icon="fa:check" className="mr-3" /> Publish
</Button>
)}
</div> </div>
) : ( ) : (
"" ""
@ -952,7 +959,10 @@ export default function FormImageDetail() {
</DialogContent> </DialogContent>
</Dialog> </Dialog>
</Card> </Card>
{(Number(detail?.needApprovalFromLevel) == Number(userLevelId)) || (detail?.isInternationalMedia == true && detail?.isForwardFromNational == true && Number(detail?.statusId) == 1) ? ( {Number(detail?.needApprovalFromLevel) == Number(userLevelId) ||
(detail?.isInternationalMedia == true &&
detail?.isForwardFromNational == true &&
Number(detail?.statusId) == 1) ? (
Number(detail?.uploadedById) == Number(userId) ? ( Number(detail?.uploadedById) == Number(userId) ? (
"" ""
) : ( ) : (

View File

@ -1053,6 +1053,9 @@ export default function FormTaskTaDetail() {
))} ))}
</div> </div>
</div> </div>
<div></div>
<div className="mt-6 space-y-2"> <div className="mt-6 space-y-2">
<Label>{t("description")}</Label> <Label>{t("description")}</Label>
<Controller <Controller

View File

@ -49,6 +49,9 @@ const ProfileInfo = () => {
}; };
useEffect(() => { useEffect(() => {
if (!username) {
router.push("/auth");
}
console.log("us", username); console.log("us", username);
}, [username]); }, [username]);