Spaces:
Sleeping
Sleeping
Update app/api/documents.py
Browse files- 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
|
| 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 |
-

|
|
|
|
| 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
|
|
|
|
|
|