Update main.py
Browse files
main.py
CHANGED
|
@@ -170,8 +170,15 @@ async def root():
|
|
| 170 |
|
| 171 |
@app.get("/recommendations")
|
| 172 |
async def get_recommendations():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
if latest_recommendations:
|
| 174 |
-
logger.info(f"
|
| 175 |
-
return
|
| 176 |
else:
|
| 177 |
-
|
|
|
|
|
|
|
|
|
| 170 |
|
| 171 |
@app.get("/recommendations")
|
| 172 |
async def get_recommendations():
|
| 173 |
+
"""
|
| 174 |
+
API endpoint to get the latest recommendations.
|
| 175 |
+
Returns:
|
| 176 |
+
list: An array of recommended property IDs, or an empty array if no recommendations are available.
|
| 177 |
+
"""
|
| 178 |
if latest_recommendations:
|
| 179 |
+
logger.info(f"Returning recommendations: {latest_recommendations}")
|
| 180 |
+
return latest_recommendations
|
| 181 |
else:
|
| 182 |
+
logger.info("No recommendations available")
|
| 183 |
+
return []
|
| 184 |
+
|