Skip to content

Commit

Permalink
update endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
MuslemRahimi committed Dec 5, 2024
1 parent e2088f9 commit 6377c72
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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",
Expand All @@ -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()
Expand Down

0 comments on commit 6377c72

Please sign in to comment.