diff --git a/components/landing-page/content-category.tsx b/components/landing-page/content-category.tsx index 85d93584..7a435628 100644 --- a/components/landing-page/content-category.tsx +++ b/components/landing-page/content-category.tsx @@ -1,6 +1,7 @@ import { getCategoryData, getPublicCategoryData, + getPublicCategoryDataNew, } from "@/service/landing/landing"; import React, { useEffect, useState } from "react"; import { Reveal } from "./Reveal"; @@ -39,7 +40,7 @@ const ContentCategory = (props: { group?: string; type: string }) => { initFetch(); }, []); const initFetch = async () => { - const response = await getPublicCategoryData( + const response = await getPublicCategoryDataNew( props.group == "mabes" ? "" : props.group == "polda" && poldaName && String(poldaName)?.length > 1 diff --git a/service/landing/landing.ts b/service/landing/landing.ts index 8a6eb00b..981ffc0b 100644 --- a/service/landing/landing.ts +++ b/service/landing/landing.ts @@ -68,6 +68,18 @@ export async function getPublicCategoryData( }&group=${group}&type=${type}&isInt=${isInt}` ); } +export async function getPublicCategoryDataNew( + group: any = "", + type: string = "", + isInt: boolean = false, + page: number = 1 +) { + return await httpGetInterceptor( + `media/categories/list/publish?enablePage=1&size=12&sort=desc&sortBy=id&page=${ + page - 1 + }&group=${group}&type=${type}&isInt=${isInt}` + ); +} export async function getCategoryData() { return await httpGetInterceptor(