fix: runbuild

This commit is contained in:
Sabda Yagra 2025-10-12 23:07:32 +07:00
parent 8d4d6f4768
commit cb439308db
4 changed files with 16 additions and 10 deletions

View File

@ -37,7 +37,7 @@ import {
} from "@tanstack/react-table"; } from "@tanstack/react-table";
import useTableColumns from "./component/columns"; import useTableColumns from "./component/columns";
import TablePagination from "@/components/table/table-pagination"; import TablePagination from "@/components/table/table-pagination";
import TenantSettingsPageTable from "./component/table-user-level"; import TenantSettingsPageTable from "./component/tenant-settings-content-table";
function TenantSettingsContent() { function TenantSettingsContent() {
const [activeTab, setActiveTab] = useState("workflows"); const [activeTab, setActiveTab] = useState("workflows");

View File

@ -5,7 +5,13 @@ import ImageDetail from "@/components/main/content/image-detail";
export default function DetailImageInfo() { export default function DetailImageInfo() {
const params = useParams(); const params = useParams();
const id = params?.id as string; const idParam = params?.id;
const id =
typeof idParam === "string"
? Number(idParam)
: Array.isArray(idParam)
? Number(idParam[0])
: 0;
return <ImageDetail id={id} />; return <ImageDetail id={id} />;
} }

View File

@ -20,7 +20,7 @@ import { toBase64, shimmer } from "@/utils/globals";
import { Skeleton } from "@/components/ui/skeleton"; import { Skeleton } from "@/components/ui/skeleton";
import { getArticleDetail } from "@/service/content/content"; import { getArticleDetail } from "@/service/content/content";
export default function ImageDetail({ id }: { id: string }) { export default function ImageDetail({ id }: { id: number }) {
const [copied, setCopied] = useState(false); const [copied, setCopied] = useState(false);
const [showShareMenu, setShowShareMenu] = useState(false); const [showShareMenu, setShowShareMenu] = useState(false);
const [data, setData] = useState<any>(null); const [data, setData] = useState<any>(null);
@ -111,12 +111,12 @@ export default function ImageDetail({ id }: { id: string }) {
} catch (err) { } catch (err) {
console.error("Gagal ambil detail artikel:", err); console.error("Gagal ambil detail artikel:", err);
// fallback ke API lama // fallback ke API lama
try { // try {
const fallback = await getDetail(id); // const fallback = await getDetail(id);
setData(fallback?.data?.data); // setData(fallback?.data?.data);
} catch (err2) { // } catch (err2) {
console.error("Fallback API juga gagal:", err2); // console.error("Fallback API juga gagal:", err2);
} // }
} finally { } finally {
setLoading(false); setLoading(false);
} }

View File

@ -578,7 +578,7 @@ export interface ArticleDetailResponse {
} }
// Function to fetch article detail // Function to fetch article detail
export async function getArticleDetail(id: string) { export async function getArticleDetail(id: number) {
const url = `articles/${id}`; const url = `articles/${id}`;
return await httpGetInterceptor(url); return await httpGetInterceptor(url);
} }