Fix entity referencing issue during post-seeded relational fetch

This commit is contained in:
dswbx
2025-01-10 17:28:43 +01:00
parent e94e8d8bd1
commit bb756548a6
11 changed files with 95 additions and 29 deletions

View File

@@ -125,12 +125,18 @@ export function DataTable<Data extends Record<string, any> = Record<string, any>
</thead>
) : null}
<tbody>
{!data || data.length === 0 ? (
{!data || !Array.isArray(data) || data.length === 0 ? (
<tr>
<td colSpan={select.length + (checkable ? 1 : 0)}>
<div className="flex flex-col gap-2 p-8 justify-center items-center border-t border-muted">
<i className="opacity-50">
{Array.isArray(data) ? "No data to show" : "Loading..."}
{Array.isArray(data) ? (
"No data to show"
) : !data ? (
"Loading..."
) : (
<pre>{JSON.stringify(data, null, 2)}</pre>
)}
</i>
</div>
</td>