mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-08-10 07:51:58 +00:00
fix: StringEndpoint not corresponding to the docs (#210)
This commit is contained in:
@@ -162,8 +162,11 @@ server
|
||||
}
|
||||
break
|
||||
default:
|
||||
result = Card.find(lang, {[endpointToField[endpoint]]: id})
|
||||
result = {
|
||||
name: id,
|
||||
cards: Card.find(lang, {[endpointToField[endpoint]]: id})
|
||||
.map((c) => c.resume())
|
||||
}
|
||||
}
|
||||
if (!result) {
|
||||
return res.status(404).send({error: "Endpoint or id not found"})
|
||||
|
@@ -73,6 +73,8 @@ export function lightCheck(source: any, item: any): boolean {
|
||||
return lightCheck(source[item], true)
|
||||
} else if (typeof source === 'string') {
|
||||
return source.toLowerCase().includes(item.toString().toLowerCase())
|
||||
} else if (typeof source === 'number') {
|
||||
return source === parseInt(item)
|
||||
} else {
|
||||
// console.log(source, item)
|
||||
return source === item
|
||||
|
Reference in New Issue
Block a user