REFACTOR API gateway fix 5
This commit is contained in:
@@ -173,7 +173,7 @@ async def import_sales_data(
|
||||
current_user: Dict[str, Any] = Depends(get_current_user_dep),
|
||||
db: AsyncSession = Depends(get_db)
|
||||
):
|
||||
"""Import sales data from file for tenant"""
|
||||
"""Import sales data from file for tenant - FIXED VERSION"""
|
||||
try:
|
||||
logger.info("Importing sales data",
|
||||
tenant_id=tenant_id,
|
||||
@@ -185,7 +185,7 @@ async def import_sales_data(
|
||||
content = await file.read()
|
||||
file_content = content.decode('utf-8')
|
||||
|
||||
# Process import
|
||||
# ✅ FIX: tenant_id comes from URL path, not file upload
|
||||
result = await DataImportService.process_upload(
|
||||
tenant_id,
|
||||
file_content,
|
||||
@@ -198,7 +198,7 @@ async def import_sales_data(
|
||||
# Publish event
|
||||
try:
|
||||
await publish_data_imported({
|
||||
"tenant_id": tenant_id,
|
||||
"tenant_id": str(tenant_id), # Ensure string conversion
|
||||
"type": "file_import",
|
||||
"format": file_format,
|
||||
"filename": file.filename,
|
||||
|
||||
Reference in New Issue
Block a user