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";
import useTableColumns from "./component/columns";
import TablePagination from "@/components/table/table-pagination";
import TenantSettingsPageTable from "./component/table-user-level";
import TenantSettingsPageTable from "./component/tenant-settings-content-table";
function TenantSettingsContent() {
const [activeTab, setActiveTab] = useState("workflows");

View File

@ -5,7 +5,13 @@ import ImageDetail from "@/components/main/content/image-detail";
export default function DetailImageInfo() {
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} />;
}

View File

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

View File

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