Compare commits
No commits in common. "7ddd584159ce5315e80dd4e5146d54a3f346d8db" and "02f23edbebe44a4961a506709b81e98096465439" have entirely different histories.
7ddd584159
...
02f23edbeb
|
|
@ -10,11 +10,17 @@ import {
|
|||
CarouselPrevious,
|
||||
} from "@/components/ui/carousel";
|
||||
import { getCookiesDecrypt } from "@/lib/utils";
|
||||
import { listCuratedContent } from "@/service/curated-content/curated-content";
|
||||
|
||||
import { formatDateToIndonesian } from "@/utils/globals";
|
||||
import { Icon } from "@iconify/react/dist/iconify.js";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { listDataTracking } from "@/service/media-tracking/media-tracking";
|
||||
import {
|
||||
listDataAllNonPagination,
|
||||
listDataTracking,
|
||||
mediaTrackingSave,
|
||||
} from "@/service/media-tracking/media-tracking";
|
||||
|
||||
type ImageData = {
|
||||
id: string;
|
||||
|
|
@ -32,6 +38,8 @@ const ImageSliderPage = () => {
|
|||
const [page, setPage] = useState(1);
|
||||
const [limit] = useState(10);
|
||||
|
||||
const ALLOWED_LEVEL = ["POLDA", "POLRES", "SATKER", "MABES"];
|
||||
|
||||
useEffect(() => {
|
||||
fetchData();
|
||||
}, [page]);
|
||||
|
|
@ -42,37 +50,37 @@ const ImageSliderPage = () => {
|
|||
// setImageData(data);
|
||||
// };
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const levelName = getCookiesDecrypt("levelName") || "";
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const levelName = getCookiesDecrypt("levelName") || "";
|
||||
|
||||
const res = await listDataTracking(
|
||||
limit,
|
||||
page - 1,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
levelName,
|
||||
);
|
||||
const res = await listDataTracking(
|
||||
limit,
|
||||
page - 1,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
levelName
|
||||
);
|
||||
|
||||
const data = res?.data?.data?.content || [];
|
||||
const data = res?.data?.data?.content || [];
|
||||
|
||||
console.log("RAW DATA:", data);
|
||||
console.log("RAW DATA:", data);
|
||||
|
||||
const mapped = data.map((item: any) => ({
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
createdAt: item.createdAt,
|
||||
timezone: item.timezone,
|
||||
thumbnailLink: item.thumbnailLink,
|
||||
clickCount: item.clickCount || 0,
|
||||
}));
|
||||
const mapped = data.map((item: any) => ({
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
createdAt: item.createdAt,
|
||||
timezone: item.timezone,
|
||||
thumbnailLink: item.thumbnailLink,
|
||||
clickCount: item.clickCount || 0,
|
||||
}));
|
||||
|
||||
setImageData(mapped);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
setImageData(mapped);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="w-full px-2">
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ export default function FormAudio() {
|
|||
];
|
||||
|
||||
const audioRefs = useRef<HTMLAudioElement[]>([]);
|
||||
const userParentLevelId = getCookiesDecrypt("uplie") || 0;
|
||||
|
||||
const { getRootProps, getInputProps } = useDropzone({
|
||||
accept: {
|
||||
|
|
@ -1809,12 +1808,11 @@ export default function FormAudio() {
|
|||
</Card>
|
||||
<div className="flex flex-row justify-end gap-3">
|
||||
<div className="mt-4">
|
||||
{levelNumber !== "2" &&
|
||||
!(levelNumber === "3" && userParentLevelId !== "771") && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
)}
|
||||
{levelNumber !== "2" && levelNumber !== "3" && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-4">
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ export default function FormImage() {
|
|||
const router = useRouter();
|
||||
const editor = useRef(null);
|
||||
const levelNumber = getCookiesDecrypt("ulne");
|
||||
const userParentLevelId = getCookiesDecrypt("uplie") || 0;
|
||||
const roleId = getCookiesDecrypt("urie");
|
||||
type ImageSchema = z.infer<typeof imageSchema>;
|
||||
const params = useParams();
|
||||
|
|
@ -1744,12 +1743,11 @@ export default function FormImage() {
|
|||
{/* <Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button> */}
|
||||
{levelNumber !== "2" &&
|
||||
!(levelNumber === "3" && userParentLevelId !== "771") && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
)}
|
||||
{levelNumber !== "2" && levelNumber !== "3" && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-4">
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ export default function FormTeks() {
|
|||
const router = useRouter();
|
||||
const editor = useRef(null);
|
||||
const levelNumber = getCookiesDecrypt("ulne");
|
||||
const userParentLevelId = getCookiesDecrypt("uplie") || 0;
|
||||
type TeksSchema = z.infer<typeof teksSchema>;
|
||||
const params = useParams();
|
||||
const locale = params?.locale;
|
||||
|
|
@ -1779,12 +1778,11 @@ export default function FormTeks() {
|
|||
{/* <Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button> */}
|
||||
{levelNumber !== "2" &&
|
||||
!(levelNumber === "3" && userParentLevelId !== "771") && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
)}
|
||||
{levelNumber !== "2" && levelNumber !== "3" && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-4">
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ export default function FormVideo() {
|
|||
polda: false,
|
||||
polres: false,
|
||||
});
|
||||
const userParentLevelId = getCookiesDecrypt("uplie") || 0;
|
||||
|
||||
let fileTypeId = "2";
|
||||
let progressInfo: any = [];
|
||||
let counterUpdateProgress = 0;
|
||||
|
|
@ -1827,12 +1827,11 @@ export default function FormVideo() {
|
|||
{/* <Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button> */}
|
||||
{levelNumber !== "2" &&
|
||||
!(levelNumber === "3" && userParentLevelId !== "771") && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
)}
|
||||
{levelNumber !== "2" && levelNumber !== "3" && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-4">
|
||||
<Button
|
||||
|
|
|
|||
Loading…
Reference in New Issue