Merge pull request #14790 from Budibase/fix-view-join-parser
Fix view join parser for non-array values any "many" types
This commit is contained in:
commit
2b9ca50923
|
@ -24,9 +24,9 @@ const columnTypeManyParser = {
|
||||||
return parsed
|
return parsed
|
||||||
}
|
}
|
||||||
|
|
||||||
return value?.map(v => parseDate(v))
|
return value.map(v => parseDate(v))
|
||||||
},
|
},
|
||||||
[FieldType.BOOLEAN]: value => value?.map(v => !!v),
|
[FieldType.BOOLEAN]: value => value.map(v => !!v),
|
||||||
[FieldType.BB_REFERENCE_SINGLE]: value => [
|
[FieldType.BB_REFERENCE_SINGLE]: value => [
|
||||||
...new Map(value.map(i => [i._id, i])).values(),
|
...new Map(value.map(i => [i._id, i])).values(),
|
||||||
],
|
],
|
||||||
|
@ -80,14 +80,10 @@ export function getRelatedTableValues(row, field, fromField) {
|
||||||
result = row[field.related.field]?.[0]?.[field.related.subField]
|
result = row[field.related.field]?.[0]?.[field.related.subField]
|
||||||
} else {
|
} else {
|
||||||
const parser = columnTypeManyParser[field.type] || (value => value)
|
const parser = columnTypeManyParser[field.type] || (value => value)
|
||||||
|
const value = row[field.related.field]
|
||||||
result = parser(
|
?.flatMap(r => r[field.related.subField])
|
||||||
row[field.related.field]
|
?.filter(i => i !== undefined && i !== null)
|
||||||
?.flatMap(r => r[field.related.subField])
|
result = parser(value || [], field)
|
||||||
?.filter(i => i !== undefined && i !== null),
|
|
||||||
field
|
|
||||||
)
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
[
|
[
|
||||||
FieldType.STRING,
|
FieldType.STRING,
|
||||||
|
|
Loading…
Reference in New Issue