fix: edit api in category landing page

This commit is contained in:
Sabda Yagra 2025-10-16 15:19:38 +07:00
parent fd6ffda5a3
commit 942b00521c
2 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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(