mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-04-22 10:52:10 +00:00
fix: specific request crash (#621)
This commit is contained in:
parent
a722ecbbda
commit
f39956e429
@ -124,20 +124,15 @@ export function recordToQuery<T extends object = object>(input: Record<string, s
|
||||
|
||||
for (const it of value) {
|
||||
const params = parseParam(key, it)
|
||||
if (!query[key]) {
|
||||
query[key] = params
|
||||
} else {
|
||||
if (isObject(params)) {
|
||||
objectLoop(params, (v, k) => {
|
||||
(query[key] as any)[k] = v
|
||||
return
|
||||
})
|
||||
} else {
|
||||
query[key] = params
|
||||
}
|
||||
}
|
||||
query[key] = query[key]
|
||||
? {
|
||||
"$and": [
|
||||
query[key],
|
||||
params
|
||||
]
|
||||
}
|
||||
: params
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return query as Query<T>
|
||||
|
Loading…
x
Reference in New Issue
Block a user