feat: update fixing error regional filter

This commit is contained in:
hanif salafi 2025-09-19 02:50:49 +07:00
parent 6fc2dd70af
commit b72e145227
6 changed files with 75 additions and 43 deletions

View File

@ -745,7 +745,6 @@ export default function FilterPage() {
startDateString={startDateString}
endDateString={endDateString}
monthYearFilter={monthYearFilter}
isRegionalCall={true}
/>
</div>
</div>

View File

@ -77,11 +77,16 @@ export default function FilterAudioComponent(props: {
let startDateFilter = startDateString ? startDateString : "";
let endDateFilter = endDateString ? endDateString : "";
let monthFilter = monthYearFilter ? monthYearFilter : "";
const search = title == undefined ? "" : title;
const filter =
categoryFilter?.length > 0
? categoryFilter?.sort().join(",")
: categorie || "";
const response = await listDataRegional(
"4",
"",
"",
search,
filter,
"",
"",
startDateFilter,
@ -95,7 +100,8 @@ export default function FilterAudioComponent(props: {
const contentData = data?.content;
setNewContent(contentData);
setTotalData(data?.totalElements);
// setLoading(false);
setTotalPage(data?.totalPages);
setTotalContent(data?.totalElements);
}
useEffect(() => {

View File

@ -79,10 +79,16 @@ export default function FilterDocumentComponent(props: {
let endDateFilter = endDateString ? endDateString : "";
let monthFilter = monthYearFilter ? monthYearFilter : "";
const search = title == undefined ? "" : title;
const filter =
categoryFilter?.length > 0
? categoryFilter?.sort().join(",")
: categorie || "";
const response = await listDataRegional(
"3",
"",
"",
search,
filter,
"",
"",
startDateFilter,
@ -96,7 +102,8 @@ export default function FilterDocumentComponent(props: {
const contentData = data?.content;
setNewContent(contentData);
setTotalData(data?.totalElements);
// setLoading(false);
setTotalPage(data?.totalPages);
setTotalContent(data?.totalElements);
}
async function getDataAll() {

View File

@ -117,10 +117,16 @@ export default function FilterImageComponent(props: {
let endDateFilter = endDateString ? endDateString : "";
let monthFilter = monthYearFilter ? monthYearFilter : "";
const search = title == undefined ? "" : title;
const filter =
categoryFilter?.length > 0
? categoryFilter?.sort().join(",")
: categorie || "";
const response = await listDataRegional(
"1",
"",
"",
search,
filter,
"",
"",
startDateFilter,
@ -134,7 +140,8 @@ export default function FilterImageComponent(props: {
const contentData = data?.content;
setNewContent(contentData);
setTotalData(data?.totalElements);
// setLoading(false);
setTotalPage(data?.totalPages);
setTotalContent(data?.totalElements);
}
const basePath = asPath.includes("/polda/")
@ -205,6 +212,7 @@ export default function FilterImageComponent(props: {
// whileHover={{ scale: 0.95 }}
// transition={{ duration: 0.3 }}
>
{image?.thumbnailLink &&
<Image
priority={true}
// placeholder={`data:image/svg+xml;base64,${toBase64(
@ -213,9 +221,10 @@ export default function FilterImageComponent(props: {
width={2560}
height={1440}
alt="image"
src={image?.smallThumbnailLink}
src={image?.thumbnailLink}
className="w-full h-full object-cover"
/>
}
</div>
{/* Badge category */}

View File

@ -171,6 +171,7 @@ export default function IndeksCarouselComponent(props: {
className="cursor-pointer relative group overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300"
>
<div className="w-full h-48 lg:h-60">
{image?.thumbnailLink &&
<Image
priority
width={2560}
@ -179,6 +180,7 @@ export default function IndeksCarouselComponent(props: {
src={image?.thumbnailLink}
className="w-full h-full object-cover"
/>
}
</div>
<div className="p-4 h-full flex flex-col justify-between">

View File

@ -79,10 +79,16 @@ export default function FilterVideoComponent(props: {
let endDateFilter = endDateString ? endDateString : "";
let monthFilter = monthYearFilter ? monthYearFilter : "";
const search = title == undefined ? "" : title;
const filter =
categoryFilter?.length > 0
? categoryFilter?.sort().join(",")
: categorie || "";
const response = await listDataRegional(
"2",
"",
"",
search,
filter,
"",
"",
startDateFilter,
@ -96,7 +102,8 @@ export default function FilterVideoComponent(props: {
const contentData = data?.content;
setNewContent(contentData);
setTotalData(data?.totalElements);
// setLoading(false);
setTotalPage(data?.totalPages);
setTotalContent(data?.totalElements);
}
async function getDataAll() {
@ -165,6 +172,7 @@ export default function FilterVideoComponent(props: {
// whileHover={{ scale: 0.95 }}
// transition={{ duration: 0.3 }}
>
{video?.thumbnailLink &&
<Image
priority={true}
// placeholder={`data:image/svg+xml;base64,${toBase64(
@ -173,9 +181,10 @@ export default function FilterVideoComponent(props: {
alt="video"
width={2560}
height={1440}
src={video?.smallThumbnailLink}
src={video?.thumbnailLink}
className="w-full h-full object-cover"
/>
}
</div>
{/* Badge category */}