diff --git a/app/[locale]/(admin)/admin/settings/tenant/component/table-user-level.tsx b/app/[locale]/(admin)/admin/settings/tenant/component/table-user-level.tsx index c216152..8083eee 100644 --- a/app/[locale]/(admin)/admin/settings/tenant/component/table-user-level.tsx +++ b/app/[locale]/(admin)/admin/settings/tenant/component/table-user-level.tsx @@ -86,7 +86,7 @@ function TenantSettingsContentTable() { setIsLoading(true); try { const [comprehensiveWorkflowRes, userLevelsRes] = await Promise.all([ - getApprovalWorkflowComprehensiveDetails(4), + getApprovalWorkflowComprehensiveDetails(), getUserLevels(), ]); diff --git a/components/landing-page/header.tsx b/components/landing-page/header.tsx index fa18a64..399a9e6 100644 --- a/components/landing-page/header.tsx +++ b/components/landing-page/header.tsx @@ -19,9 +19,16 @@ export default function Header() { const fetchData = async () => { try { // Use new Articles API - const response = await listArticles(1, 5, undefined, undefined, undefined, "createdAt"); + const response = await listArticles( + 1, + 5, + undefined, + undefined, + undefined, + "createdAt" + ); console.log("Articles API response:", response); - + if (response?.error) { console.error("Articles API failed, falling back to old API"); // Fallback to old API @@ -44,19 +51,31 @@ export default function Header() { // Handle new API response structure const articlesData = response?.data?.data || []; console.log("Articles data:", articlesData); - + // Transform articles data to match old structure for backward compatibility const transformedData = articlesData.map((article: any) => ({ id: article.id, title: article.title, - categoryName: article.categoryName || (article.categories && article.categories[0]?.title) || "", + categoryName: + article.categoryName || + (article.categories && article.categories[0]?.title) || + "", createdAt: article.createdAt, smallThumbnailLink: article.thumbnailUrl, fileTypeId: article.typeId, - label: article.typeId === 1 ? "Image" : article.typeId === 2 ? "Video" : article.typeId === 3 ? "Text" : article.typeId === 4 ? "Audio" : "", - ...article + label: + article.typeId === 1 + ? "Image" + : article.typeId === 2 + ? "Video" + : article.typeId === 3 + ? "Text" + : article.typeId === 4 + ? "Audio" + : "", + ...article, })); - + setData(transformedData); } catch (error) { console.error("Gagal memuat data:", error); @@ -150,7 +169,10 @@ function Card({ item, isBig = false }: { item: any; isBig?: boolean }) { {item.categoryName} - {item.label} + + {" "} + {item.categories?.map((cat: any) => cat.title).join(", ")} +