tcgdex / cards-database

Pokémon Trading Card Game Card (TCG) Database for the TCGdex API. ⭐ Leave a star if the project interest you !
https://www.tcgdex.net
MIT License
178 stars 40 forks source link

issue: specific request crash the request #566

Open Aviortheking opened 4 weeks ago

Aviortheking commented 4 weeks ago

Where are you having the issue

Is the issue affecting one of the two elements below ?

Description

https://api.tcgdex.net/v2/fr/cards?name=eq:Pikachu&name=eq:Pichu,Pikachu

Aviortheking commented 3 weeks ago

The error

2024-11-05T17:56:46.563Z bruno-runtime/1.33.0             GET                   /v2/fr/cards?name=eq:Pikachu&name=eq:Pichu,Pikachu
-------------------------------------------------------------- ERROR --------------------------------------------------------------
127 |           if (!query[key]) {
128 |               query[key] = params
129 |           } else {
130 |               if (isObject(params)) {
131 |                   objectLoop(params, (v, k) => {
132 |                       (query[key] as any)[k] = v
                   ^
TypeError: Attempted to assign to readonly property.
      at /home/avior/Documents/tcgdex/cards-database/server/src/libs/QueryEngine/parsers.ts:132:14
      at objectLoop (/home/avior/Documents/tcgdex/cards-database/server/node_modules/@dzeio/object-util/dist/ObjectUtil.mjs:27:18)
      at /home/avior/Documents/tcgdex/cards-database/server/src/libs/QueryEngine/parsers.ts:131:6
      at objectLoop (/home/avior/Documents/tcgdex/cards-database/server/node_modules/@dzeio/object-util/dist/ObjectUtil.mjs:27:18)
      at recordToQuery (/home/avior/Documents/tcgdex/cards-database/server/src/libs/QueryEngine/parsers.ts:105:2)
      at /home/avior/Documents/tcgdex/cards-database/server/src/V2/endpoints/jsonEndpoints.ts:70:18
      at handle (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/layer.js:95:5)
      at trim_prefix (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:328:13)
      at /home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:286:9
      at next (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:280:10)
      at /home/avior/Documents/tcgdex/cards-database/server/src/V2/endpoints/jsonEndpoints.ts:59:3
      at handle (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/layer.js:95:5)
      at trim_prefix (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:328:13)
      at /home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:286:9
      at next (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:280:10)
      at makeResponseCacheable (/home/avior/Documents/tcgdex/cards-database/server/node_modules/apicache/src/apicache.js:242:5)
      at cache (/home/avior/Documents/tcgdex/cards-database/server/node_modules/apicache/src/apicache.js:689:16)
      at handle (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/layer.js:95:5)
      at trim_prefix (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:328:13)
      at /home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:286:9
      at next (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:280:10)
      at handle (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:175:3)
      at router (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:47:12)
      at handle (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/layer.js:95:5)
      at trim_prefix (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:328:13)
      at /home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:286:9
      at next (/home/avior/Documents/tcgdex/cards-database/server/node_modules/express/lib/router/index.js:280:10)
      at error (/home/avior/Documents/tcgdex/cards-database/server/node_modules/serve-static/index.js:121:7)
      at node:events:2:25
      at onStatError (/home/avior/Documents/tcgdex/cards-database/server/node_modules/send/index.js:417:12)

-------------------------------------------------------------- ERROR --------------------------------------------------------------