[#3372] fixed Admin UI listing error on invalid record relation

This commit is contained in:
Gani Georgiev
2023-09-22 18:19:05 +03:00
parent f605521208
commit 92731ddd50
37 changed files with 111 additions and 90 deletions

View File

@@ -11,7 +11,7 @@
export let field;
export let short = false;
$: rawValue = record[field.name];
$: rawValue = record?.[field.name];
</script>
{#if field.type === "json"}
@@ -83,7 +83,7 @@
</div>
{:else if field.type === "relation"}
{@const relations = CommonHelper.toArray(rawValue)}
{@const expanded = CommonHelper.toArray(record.expand[field.name])}
{@const expanded = CommonHelper.toArray(record?.expand?.[field.name])}
{@const relLimit = short ? 20 : 500}
<div class="inline-flex">
{#if expanded.length}