Handle non-array values

This commit is contained in:
Mel O'Hagan 2022-08-05 14:53:41 +01:00
parent 29c0e07b7e
commit 61d46062b7
1 changed files with 3 additions and 0 deletions

View File

@ -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))
} }