feat: Generate absolute URL for job image endpoint in job status response
Browse files- backend/api/posts.py +3 -1
backend/api/posts.py
CHANGED
|
@@ -286,7 +286,9 @@ def get_job_status(job_id):
|
|
| 286 |
if os.path.exists(image_data):
|
| 287 |
# Store the file path in job store for later retrieval
|
| 288 |
job['image_file_path'] = image_data
|
| 289 |
-
|
|
|
|
|
|
|
| 290 |
response_data['has_image_data'] = True
|
| 291 |
response_data['image_data'] = image_data
|
| 292 |
else:
|
|
|
|
| 286 |
if os.path.exists(image_data):
|
| 287 |
# Store the file path in job store for later retrieval
|
| 288 |
job['image_file_path'] = image_data
|
| 289 |
+
# Generate absolute URL instead of relative URL
|
| 290 |
+
base_url = request.host_url.rstrip('/')
|
| 291 |
+
response_data['image_url'] = f"{base_url}/api/posts/image/{job_id}" # API endpoint to serve the image
|
| 292 |
response_data['has_image_data'] = True
|
| 293 |
response_data['image_data'] = image_data
|
| 294 |
else:
|