Make sure linkedRows is an array before map

This commit is contained in:
Mel O'Hagan 2022-05-26 13:00:19 +01:00
parent 48df8b81c7
commit 7da5a10c2e
1 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,9 @@
export let linkedRows = []
let rows = []
let linkedIds = (linkedRows || [])?.map(row => row?._id || row)
let linkedIds = (Array.isArray(linkedRows) ? linkedRows : [])?.map(
row => row?._id || row
)
$: linkedRows = linkedIds
$: label = capitalise(schema.name)