mirror of
https://github.com/strapi/strapi.git
synced 2025-09-21 22:40:24 +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(
|
const options = useMemo(
|
||||||
() =>
|
() =>
|
||||||
data.flat().map((result) =>
|
data
|
||||||
result
|
.flat()
|
||||||
? {
|
.filter(Boolean)
|
||||||
...result,
|
.map((result) => ({
|
||||||
value: result.id,
|
...result,
|
||||||
label: result.mainField,
|
value: result.id,
|
||||||
}
|
label: result.mainField,
|
||||||
: result
|
})),
|
||||||
),
|
|
||||||
[data]
|
[data]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user