Refactor storage URL retrieval to use get_uploaded_file_url.
Some checks failed
Build and Push Docker Images / build-frontend (push) Blocked by required conditions
Build and Push Docker Images / changes (push) Successful in 3s
Build and Push Docker Images / build-backend (push) Has been cancelled

Replaced calls to get_file_url with get_uploaded_file_url where appropriate. Added the get_uploaded_file_url method to the StorageProvider class and its implementations for more specific URL generation. Updated corresponding tests and API routes to reflect this change.
This commit is contained in:
2025-03-14 00:05:07 +01:00
parent 8c1e6b7ebe
commit 0cf5498762
3 changed files with 13 additions and 5 deletions

View File

@@ -13,8 +13,6 @@ from app.schemas.presigned_urls import PresignedUrlResponse, PresignedUrlRequest
router = APIRouter()
@router.post("/presigned-url", response_model=PresignedUrlResponse, operation_id="generate_presigned_url")
async def generate_presigned_url(
request: PresignedUrlRequest,
@@ -98,7 +96,7 @@ async def upload_file(
await storage.save_file(file, destination)
# Return the file URL
return {"file_url": storage.get_file_url(destination)}
return {"file_url": storage.get_uploaded_file_url(destination)}
except Exception as e:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,