relation fixes

This commit is contained in:
2026-04-02 20:30:21 +05:30
parent a8581325fa
commit 71f7ee83f1
2 changed files with 69 additions and 64 deletions

View File

@@ -52,7 +52,7 @@ export default function EnhancedTable({
// 2. Relational Link
if (field.relation && value) {
const relationId = typeof value === 'object' ? value.id : value;
const relationId = typeof value === 'object' ? (value.id || value._id || value.pk) : value;
if (relationId) {
return (
<Link
@@ -60,7 +60,7 @@ export default function EnhancedTable({
variant="body2"
onClick={(e) => {
e.stopPropagation();
onNavigateToResource?.(field.relation!, relationId);
onNavigateToResource?.(field.relation!, String(relationId));
}}
>
{relationId}