From 97c67890b50ea8aeb62b1578144620c95679dc49 Mon Sep 17 00:00:00 2001 From: Ken Verhaegen Date: Tue, 6 Feb 2024 15:18:57 +0100 Subject: [PATCH] Fix the find method of the Card model. (#12) Currently the find method returns a set of multiple cards, because currently the endpoint is looked up with `cards?id=`. The [documentation](https://docs.pokemontcg.io/api-reference/cards/get-card) states that the endpoint is `cards/`. This change has the same behavior as the find method on the Sets model. --- src/Models/Card.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Models/Card.php b/src/Models/Card.php index 26665cf..84130d3 100644 --- a/src/Models/Card.php +++ b/src/Models/Card.php @@ -16,12 +16,9 @@ class Card extends Model */ public function find(string $pokemonTcgId): mixed { - return $this->resolveResponse( - $this->client->get($this->getEndpoint(), [ - 'id' => $pokemonTcgId, - ]), - $this->getEndpoint().$pokemonTcgId - ); + $endpoint = $this->getEndpoint() . '/' . $pokemonTcgId; + + return $this->resolveResponse($this->client->get($endpoint), $endpoint); } /**