Spaces:
Sleeping

thabsheeeeeer commited on
Commit
85b7acd
·
verified ·
1 Parent(s): 7d1aaf0

Update app/api/documents.py

Browse files
Files changed (1) hide show
  1. app/api/documents.py +2 -3
app/api/documents.py CHANGED
@@ -3,6 +3,7 @@ import io
3
  from fastapi import APIRouter, Depends, HTTPException
4
  from fastapi.responses import FileResponse, StreamingResponse
5
  from sqlalchemy.orm import Session
 
6
 
7
  from app.db.database import get_db
8
  from app.core.dependencies import get_current_user
@@ -54,7 +55,7 @@ def get_document_file(
54
 
55
  # Check if it's GCS path
56
  if document.file_path.startswith("uploads/"):
57
- print(f"DEBUG: Attempting to download {document.file_path} from bucket {storage_service.client.storage.from_('documents') if storage_service.client else 'None'}")
58
  content = storage_service.download_file(document.file_path)
59
  if not content:
60
  print(f"ERROR: File download failed for path: {document.file_path}")
@@ -125,5 +126,3 @@ def delete_document(
125
  )
126
 
127
  return response
128
-
129
- ![image](https://cdn-uploads.huggingface.co/production/uploads/69fddecca069a32448f4036d/35DV6hvOUO6GWPHqNbPYp.png)
 
3
  from fastapi import APIRouter, Depends, HTTPException
4
  from fastapi.responses import FileResponse, StreamingResponse
5
  from sqlalchemy.orm import Session
6
+ from sqlalchemy import func
7
 
8
  from app.db.database import get_db
9
  from app.core.dependencies import get_current_user
 
55
 
56
  # Check if it's GCS path
57
  if document.file_path.startswith("uploads/"):
58
+ print(f"DEBUG: Attempting to download {document.file_path} from Supabase")
59
  content = storage_service.download_file(document.file_path)
60
  if not content:
61
  print(f"ERROR: File download failed for path: {document.file_path}")
 
126
  )
127
 
128
  return response