Seth commited on
Commit
f5f5eec
·
1 Parent(s): ae29cd9
Files changed (1) hide show
  1. backend/app/main.py +5 -5
backend/app/main.py CHANGED
@@ -156,7 +156,7 @@ async def generate_ai_content(request: AIContentRequest, db: Session = Depends(g
156
  asset_insights = []
157
  for asset in db_assets:
158
  asset_dict = {
159
- "id": asset.id,
160
  "name": asset.name,
161
  "product_category": asset.product_category,
162
  "extracted_content": asset.extracted_content if hasattr(asset, 'extracted_content') else None
@@ -265,7 +265,7 @@ async def get_asset_status(asset_id, db: Session = Depends(get_db)):
265
 
266
  if row:
267
  result = {
268
- "asset_id": row[0],
269
  "name": row[1],
270
  "status": row[2] or "pending",
271
  "analyzed_at": row[3].isoformat() if row[3] else None,
@@ -533,7 +533,7 @@ async def upload_asset(
533
  asyncio.create_task(analyze_asset_background(asset_id, str(file_path), file_type))
534
 
535
  return {
536
- "id": db_asset.id,
537
  "name": db_asset.name,
538
  "file_type": db_asset.file_type,
539
  "product_category": db_asset.product_category,
@@ -581,7 +581,7 @@ async def get_assets(
581
  assets = []
582
  for asset in db_assets:
583
  assets.append({
584
- "id": asset.id,
585
  "name": asset.name,
586
  "file_type": asset.file_type,
587
  "product_category": asset.product_category,
@@ -623,7 +623,7 @@ async def get_assets(
623
  assets = []
624
  for row in rows:
625
  assets.append({
626
- "id": row[0],
627
  "name": row[1],
628
  "file_type": row[3],
629
  "product_category": row[4],
 
156
  asset_insights = []
157
  for asset in db_assets:
158
  asset_dict = {
159
+ "id": str(asset.id), # Return as string to preserve precision
160
  "name": asset.name,
161
  "product_category": asset.product_category,
162
  "extracted_content": asset.extracted_content if hasattr(asset, 'extracted_content') else None
 
265
 
266
  if row:
267
  result = {
268
+ "asset_id": str(row[0]), # Return as string to preserve precision for large IDs
269
  "name": row[1],
270
  "status": row[2] or "pending",
271
  "analyzed_at": row[3].isoformat() if row[3] else None,
 
533
  asyncio.create_task(analyze_asset_background(asset_id, str(file_path), file_type))
534
 
535
  return {
536
+ "id": str(db_asset.id), # Return as string to preserve precision for large IDs
537
  "name": db_asset.name,
538
  "file_type": db_asset.file_type,
539
  "product_category": db_asset.product_category,
 
581
  assets = []
582
  for asset in db_assets:
583
  assets.append({
584
+ "id": str(asset.id), # Return as string to preserve precision
585
  "name": asset.name,
586
  "file_type": asset.file_type,
587
  "product_category": asset.product_category,
 
623
  assets = []
624
  for row in rows:
625
  assets.append({
626
+ "id": str(row[0]), # Return as string to preserve precision
627
  "name": row[1],
628
  "file_type": row[3],
629
  "product_category": row[4],