From 6377c728999fb2edac85eb25a19411f788a3b642 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 5 Dec 2024 22:26:18 +0100 Subject: [PATCH] update endpoint --- app/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 6b9eec5..ef81a08 100755 --- a/app/main.py +++ b/app/main.py @@ -1431,7 +1431,7 @@ async def fetch_quote_data(item): 'symbol': item.symbol, 'name': getattr(item, 'name', ''), 'id': item.id, - 'assetType': getattr(item, 'asset_type', ''), + 'type': getattr(item, 'asset_type', '').lower().replace("stock", "stocks"), 'targetPrice': getattr(item, 'target_price', None), 'condition': getattr(item, 'condition', '').capitalize(), 'priceWhenCreated': getattr(item, 'price_when_created', None), @@ -1469,7 +1469,7 @@ async def fetch_quote_data(item): # Serialize and compress the response data res_serialized = orjson.dumps(res) compressed_data = gzip.compress(res_serialized) - print(combined_earnings) + return StreamingResponse( io.BytesIO(compressed_data), media_type="application/json", @@ -1479,6 +1479,8 @@ async def fetch_quote_data(item): except Exception as e: raise HTTPException(status_code=500, detail=f"Internal server error: {str(e)}") + + def process_option_activity(item): item['put_call'] = 'Calls' if item['put_call'] == 'CALL' else 'Puts' item['underlying_type'] = item['underlying_type'].lower()