1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-04-22 19:02:10 +00:00

fix: specific request crash (#621)

This commit is contained in:
Benjamin Rousseliere 2025-01-09 23:48:58 +01:00 committed by GitHub
parent a722ecbbda
commit f39956e429
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,20 +124,15 @@ export function recordToQuery<T extends object = object>(input: Record<string, s
for (const it of value) { for (const it of value) {
const params = parseParam(key, it) const params = parseParam(key, it)
if (!query[key]) { query[key] = query[key]
query[key] = params ? {
} else { "$and": [
if (isObject(params)) { query[key],
objectLoop(params, (v, k) => { params
(query[key] as any)[k] = v ]
return }
}) : params
} else {
query[key] = params
}
}
} }
}) })
return query as Query<T> return query as Query<T>