fix(index): query builder handle json array (#12480)
* fix(index): query builder handle json array * fix sales channel event names
This commit is contained in:
committed by
GitHub
parent
7fdbf2a965
commit
c661e06488
@@ -308,6 +308,7 @@ export class QueryBuilder {
|
||||
[targetField]: item === null ? null : item,
|
||||
})
|
||||
)
|
||||
|
||||
builder.whereRaw(
|
||||
`${aliasMapping[attr]}.data${nested} @> ANY(ARRAY[${inPlaceholders}]::JSONB[])`,
|
||||
jsonbValues
|
||||
@@ -355,11 +356,13 @@ export class QueryBuilder {
|
||||
[...value]
|
||||
)
|
||||
} else {
|
||||
const targetField = field[field.length - 1] as string
|
||||
|
||||
const jsonbValues = value.map((item) =>
|
||||
JSON.stringify({ [nested]: item === null ? null : item })
|
||||
JSON.stringify({ [targetField]: item === null ? null : item })
|
||||
)
|
||||
builder.whereRaw(
|
||||
`${aliasMapping[attr]}.data IN ANY(ARRAY[${inPlaceholders}]::JSONB[])`,
|
||||
`${aliasMapping[attr]}.data${nested} @> ANY(ARRAY[${inPlaceholders}]::JSONB[])`,
|
||||
jsonbValues
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user