aboutsummaryrefslogtreecommitdiff
path: root/oop2eindopdr/Pokedex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'oop2eindopdr/Pokedex.cpp')
-rw-r--r--oop2eindopdr/Pokedex.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/oop2eindopdr/Pokedex.cpp b/oop2eindopdr/Pokedex.cpp
index 8a9defe..c55469a 100644
--- a/oop2eindopdr/Pokedex.cpp
+++ b/oop2eindopdr/Pokedex.cpp
@@ -44,6 +44,7 @@ void Pokedex::load_collection_local() {
while (std::getline(cache_collection, id)) {
this->cards.push_back(new PokemonCard::from_cache(this, id));
}
+ cache_collection.close();
}
void Pokedex::verify_collection() {
@@ -79,7 +80,7 @@ std::vector<PokemonCard*> Pokedex::search_cards_by_id_local(std::string query) {
std::vector<PokemonCard*> Pokedex::search_cards_by_id_remote(std::string query) {
std::cout << "couldn't find card in cache, trying api..." << std::endl;
- std::vector<PokemonCard*> api_cards = api->get_cards_by_query((std::string("name:\"") + query + "\" OR id:\"" + query + "\"").c_str());
+ std::vector<PokemonCard*> api_cards = api->get_cards_by_query((std::string("name:\"") + query + "\" OR id:*" + query + "*").c_str());
std::vector<PokemonCard*> out;
for (PokemonCard* api_card : api_cards) {