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

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

View File

@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---
chore(medusa): Align build query utils

View File

@@ -122,14 +122,18 @@ function buildWhere<TWhereKeys extends object, TEntity>(
break
default:
if (objectValue != undefined && typeof objectValue === "object") {
where[key].push(buildWhere<any, TEntity>(objectValue))
where[key] = buildWhere<any, TEntity>(objectValue)
return
}
where[key].push(value)
where[key] = value
}
return
})
if (!Array.isArray(where[key])) {
continue
}
if (where[key].length === 1) {
where[key] = where[key][0]
} else {