Handle non-array values
This commit is contained in:
parent
1a43b72dfe
commit
15ffa76d6f
|
@ -55,6 +55,9 @@
|
||||||
if (!values) {
|
if (!values) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
if (!Array.isArray(values)) {
|
||||||
|
values = [values]
|
||||||
|
}
|
||||||
return values.map(value => (typeof value === "object" ? value._id : value))
|
return values.map(value => (typeof value === "object" ? value._id : value))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue