Refactor storage URL retrieval to use get_uploaded_file_url.
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user