From a0cb4cc9bfdfe0daafea5b3f9c3fb79e45e436b3 Mon Sep 17 00:00:00 2001 From: Sabda Yagra Date: Tue, 10 Feb 2026 13:10:40 +0700 Subject: [PATCH] fix: detail and thumbnail categories --- .../categories/categories-detail-form.tsx | 31 ++++++++++++++++--- .../management-user-internal-column-table.tsx | 14 ++++----- service/user.ts | 5 +++ 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/components/form/categories/categories-detail-form.tsx b/components/form/categories/categories-detail-form.tsx index 5c7b8fe..f159059 100644 --- a/components/form/categories/categories-detail-form.tsx +++ b/components/form/categories/categories-detail-form.tsx @@ -8,6 +8,7 @@ import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { formatDateToIndonesian } from "@/utils/globals"; import { getArticleCategoryDetail } from "@/service/categories/categories"; +import { getUserInfo } from "@/service/user"; type CategoryDetail = { id: number; @@ -27,11 +28,22 @@ type CategoryDetail = { updatedAt: string; }; +type CurrentUser = { + id: number; + username: string; + fullname?: string; +}; + export default function CategoriesDetailForm() { const { id } = useParams() as { id: string }; const router = useRouter(); const [detail, setDetail] = useState(null); - + const [currentUser, setCurrentUser] = useState(null); + + useEffect(() => { + getUserInfo().then((res) => setCurrentUser(res.data.data)); + }, []); + useEffect(() => { async function init() { if (id) { @@ -50,7 +62,7 @@ export default function CategoriesDetailForm() {
{detail ? (
- {/* MAIN FORM */} + {/* MAIN FORM */}

Form Category Detail

@@ -77,7 +89,7 @@ export default function CategoriesDetailForm() {
{/* Thumbnail */} -
+ {/*
-
+
*/} {/* Tags */} {/*
@@ -112,10 +124,19 @@ export default function CategoriesDetailForm() {
+ + {/* + /> */}
{/* Status */} diff --git a/components/table/management-user/management-user-internal-column-table.tsx b/components/table/management-user/management-user-internal-column-table.tsx index 95e637d..c467441 100644 --- a/components/table/management-user/management-user-internal-column-table.tsx +++ b/components/table/management-user/management-user-internal-column-table.tsx @@ -58,13 +58,13 @@ const columns: ColumnDef[] = [ {row.getValue("userLevelGroup") || "-"} ), }, - { - accessorKey: "statusId", - header: "Status ID", - cell: ({ row }) => ( - {row.getValue("statusId")} - ), - }, + // { + // accessorKey: "statusId", + // header: "Status ID", + // cell: ({ row }) => ( + // {row.getValue("statusId")} + // ), + // }, { accessorKey: "createdAt", header: "Tanggal Unggah", diff --git a/service/user.ts b/service/user.ts index f82bdeb..4551603 100644 --- a/service/user.ts +++ b/service/user.ts @@ -3,3 +3,8 @@ import { httpGetInterceptor } from "./http-config/http-interceptor-service"; export function getUserInfo() { return httpGetInterceptor("users/info"); } + +export function getUserById(userId: number) { + return httpGetInterceptor(`users/${userId}`); +} +