chore(medusa): Align build query utils (#4148)
This commit is contained in:
1 parent
bf18bd0c8a
commit
c0e527d6e0
2 files changed
+11
-2
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/utils": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
chore(medusa): Align build query utils
|
||||||
@@ -122,14 +122,18 @@ function buildWhere<TWhereKeys extends object, TEntity>(
|
|||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
if (objectValue != undefined && typeof objectValue === "object") {
|
if (objectValue != undefined && typeof objectValue === "object") {
|
||||||
where[key].push(buildWhere<any, TEntity>(objectValue))
|
where[key] = buildWhere<any, TEntity>(objectValue)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
where[key].push(value)
|
where[key] = value
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!Array.isArray(where[key])) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if (where[key].length === 1) {
|
if (where[key].length === 1) {
|
||||||
where[key] = where[key][0]
|
where[key] = where[key][0]
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user