chore(medusa): Align build query utils (#4148)

This commit is contained in:
Adrien de Peretti authored and GitHub committed 2023-05-22 15:14:14 +02:00
1 parent bf18bd0c8a
commit c0e527d6e0
2 files changed
+11 -2

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---
chore(medusa): Align build query utils
+6 -2
View File
@@ -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 {