order fix
This commit is contained in:
parent
1bf255d0fe
commit
4c6d256316
@ -39,8 +39,10 @@ class TCGPlayerAPIService:
|
||||
|
||||
def get_product_ids_from_sku(self, sku_ids: list[str]) -> dict:
|
||||
"""Get product IDs from TCGPlayer SKU IDs"""
|
||||
# convert SKU IDs to integers
|
||||
sku_ids = [int(sku_id) for sku_id in sku_ids]
|
||||
tcg_cards = self.db.query(CardTCGPlayer).filter(CardTCGPlayer.tcgplayer_id.in_(sku_ids)).all()
|
||||
return {card.tcgplayer_id: card.product_id for card in tcg_cards}
|
||||
return {str(card.tcgplayer_id): card.product_id for card in tcg_cards}
|
||||
|
||||
def save_order(self, order: dict):
|
||||
# check if order exists by order number
|
||||
|
@ -106,6 +106,7 @@ class RequestsUtil:
|
||||
raise ValueError("Headers not set")
|
||||
|
||||
try:
|
||||
self.rate_limit()
|
||||
response = requests.request(method, url, headers=headers, cookies=cookies, data=data)
|
||||
response.raise_for_status()
|
||||
self.previous_request_time = datetime.now()
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user