mirror of
https://github.com/strapi/strapi.git
synced 2025-09-21 14:31:16 +00:00
chore: run filter before map
This commit is contained in:
parent
5b6a261d55
commit
bad0ee958b
@ -98,15 +98,14 @@ const RelationInput = ({
|
||||
|
||||
const options = useMemo(
|
||||
() =>
|
||||
data.flat().map((result) =>
|
||||
result
|
||||
? {
|
||||
...result,
|
||||
value: result.id,
|
||||
label: result.mainField,
|
||||
}
|
||||
: result
|
||||
),
|
||||
data
|
||||
.flat()
|
||||
.filter(Boolean)
|
||||
.map((result) => ({
|
||||
...result,
|
||||
value: result.id,
|
||||
label: result.mainField,
|
||||
})),
|
||||
[data]
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user