Compare commits

...

2 Commits

Author SHA1 Message Date
Sabda Yagra 7ddd584159 fix: check button send in create content
continuous-integration/drone/push Build is passing Details
2026-04-09 10:36:19 +07:00
Sabda Yagra 8fd15cb136 fixing 2026-04-07 14:34:51 +07:00
5 changed files with 55 additions and 56 deletions

View File

@ -10,17 +10,11 @@ import {
CarouselPrevious, CarouselPrevious,
} from "@/components/ui/carousel"; } from "@/components/ui/carousel";
import { getCookiesDecrypt } from "@/lib/utils"; import { getCookiesDecrypt } from "@/lib/utils";
import { listCuratedContent } from "@/service/curated-content/curated-content";
import { formatDateToIndonesian } from "@/utils/globals"; import { formatDateToIndonesian } from "@/utils/globals";
import { Icon } from "@iconify/react/dist/iconify.js"; import { Icon } from "@iconify/react/dist/iconify.js";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { import { listDataTracking } from "@/service/media-tracking/media-tracking";
listDataAllNonPagination,
listDataTracking,
mediaTrackingSave,
} from "@/service/media-tracking/media-tracking";
type ImageData = { type ImageData = {
id: string; id: string;
@ -38,8 +32,6 @@ const ImageSliderPage = () => {
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
const [limit] = useState(10); const [limit] = useState(10);
const ALLOWED_LEVEL = ["POLDA", "POLRES", "SATKER", "MABES"];
useEffect(() => { useEffect(() => {
fetchData(); fetchData();
}, [page]); }, [page]);
@ -50,7 +42,7 @@ const ImageSliderPage = () => {
// setImageData(data); // setImageData(data);
// }; // };
const fetchData = async () => { const fetchData = async () => {
try { try {
const levelName = getCookiesDecrypt("levelName") || ""; const levelName = getCookiesDecrypt("levelName") || "";
@ -60,7 +52,7 @@ const fetchData = async () => {
"", "",
"", "",
"", "",
levelName levelName,
); );
const data = res?.data?.data?.content || []; const data = res?.data?.data?.content || [];
@ -80,7 +72,7 @@ const fetchData = async () => {
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
}; };
return ( return (
<div className="w-full px-2"> <div className="w-full px-2">

View File

@ -160,6 +160,7 @@ export default function FormAudio() {
]; ];
const audioRefs = useRef<HTMLAudioElement[]>([]); const audioRefs = useRef<HTMLAudioElement[]>([]);
const userParentLevelId = getCookiesDecrypt("uplie") || 0;
const { getRootProps, getInputProps } = useDropzone({ const { getRootProps, getInputProps } = useDropzone({
accept: { accept: {
@ -1808,7 +1809,8 @@ export default function FormAudio() {
</Card> </Card>
<div className="flex flex-row justify-end gap-3"> <div className="flex flex-row justify-end gap-3">
<div className="mt-4"> <div className="mt-4">
{levelNumber !== "2" && levelNumber !== "3" && ( {levelNumber !== "2" &&
!(levelNumber === "3" && userParentLevelId !== "771") && (
<Button type="submit" color="primary"> <Button type="submit" color="primary">
{t("submit", { defaultValue: "Submit" })} {t("submit", { defaultValue: "Submit" })}
</Button> </Button>

View File

@ -90,6 +90,7 @@ export default function FormImage() {
const router = useRouter(); const router = useRouter();
const editor = useRef(null); const editor = useRef(null);
const levelNumber = getCookiesDecrypt("ulne"); const levelNumber = getCookiesDecrypt("ulne");
const userParentLevelId = getCookiesDecrypt("uplie") || 0;
const roleId = getCookiesDecrypt("urie"); const roleId = getCookiesDecrypt("urie");
type ImageSchema = z.infer<typeof imageSchema>; type ImageSchema = z.infer<typeof imageSchema>;
const params = useParams(); const params = useParams();
@ -1743,7 +1744,8 @@ export default function FormImage() {
{/* <Button type="submit" color="primary"> {/* <Button type="submit" color="primary">
{t("submit", { defaultValue: "Submit" })} {t("submit", { defaultValue: "Submit" })}
</Button> */} </Button> */}
{levelNumber !== "2" && levelNumber !== "3" && ( {levelNumber !== "2" &&
!(levelNumber === "3" && userParentLevelId !== "771") && (
<Button type="submit" color="primary"> <Button type="submit" color="primary">
{t("submit", { defaultValue: "Submit" })} {t("submit", { defaultValue: "Submit" })}
</Button> </Button>

View File

@ -84,6 +84,7 @@ export default function FormTeks() {
const router = useRouter(); const router = useRouter();
const editor = useRef(null); const editor = useRef(null);
const levelNumber = getCookiesDecrypt("ulne"); const levelNumber = getCookiesDecrypt("ulne");
const userParentLevelId = getCookiesDecrypt("uplie") || 0;
type TeksSchema = z.infer<typeof teksSchema>; type TeksSchema = z.infer<typeof teksSchema>;
const params = useParams(); const params = useParams();
const locale = params?.locale; const locale = params?.locale;
@ -1778,7 +1779,8 @@ export default function FormTeks() {
{/* <Button type="submit" color="primary"> {/* <Button type="submit" color="primary">
{t("submit", { defaultValue: "Submit" })} {t("submit", { defaultValue: "Submit" })}
</Button> */} </Button> */}
{levelNumber !== "2" && levelNumber !== "3" && ( {levelNumber !== "2" &&
!(levelNumber === "3" && userParentLevelId !== "771") && (
<Button type="submit" color="primary"> <Button type="submit" color="primary">
{t("submit", { defaultValue: "Submit" })} {t("submit", { defaultValue: "Submit" })}
</Button> </Button>

View File

@ -132,7 +132,7 @@ export default function FormVideo() {
polda: false, polda: false,
polres: false, polres: false,
}); });
const userParentLevelId = getCookiesDecrypt("uplie") || 0;
let fileTypeId = "2"; let fileTypeId = "2";
let progressInfo: any = []; let progressInfo: any = [];
let counterUpdateProgress = 0; let counterUpdateProgress = 0;
@ -1827,7 +1827,8 @@ export default function FormVideo() {
{/* <Button type="submit" color="primary"> {/* <Button type="submit" color="primary">
{t("submit", { defaultValue: "Submit" })} {t("submit", { defaultValue: "Submit" })}
</Button> */} </Button> */}
{levelNumber !== "2" && levelNumber !== "3" && ( {levelNumber !== "2" &&
!(levelNumber === "3" && userParentLevelId !== "771") && (
<Button type="submit" color="primary"> <Button type="submit" color="primary">
{t("submit", { defaultValue: "Submit" })} {t("submit", { defaultValue: "Submit" })}
</Button> </Button>