Allow filtering by tier in search call

This commit is contained in:
Henry 2020-10-23 12:28:21 +01:00
parent 792edb4c88
commit 2462d6768a

View file

@ -12,8 +12,8 @@ class SoulServer:
await self.soul_client.connect() await self.soul_client.connect()
@router.expose @router.expose
async def search_cards(self, search_term): async def search_cards(self, search_term, tier=None):
r = await self.soul_client.call("cardindex", {"search": search_term}) r = await self.soul_client.call("cardindex", {"search": search_term, "category": tier})
cards = [Card(doc).to_dict() for doc in r['data']['docs']] cards = [Card(doc).to_dict() for doc in r['data']['docs']]
return cards return cards