fix: runbuild
This commit is contained in:
parent
8d4d6f4768
commit
cb439308db
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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} />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue