Emmanuel Frimpong Asante
commited on
Commit
·
e03a8bb
1
Parent(s):
543e5e7
update space
Browse files
backend/app/routes/dashboard.py
CHANGED
|
@@ -63,10 +63,14 @@ async def get_dashboard_data(current_user: dict = Depends(get_current_user)):
|
|
| 63 |
|
| 64 |
# Recent tasks and health records (admin)
|
| 65 |
response_data["recentTasks"] = list(
|
| 66 |
-
db.tasks.find(
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
| 69 |
)
|
|
|
|
| 70 |
response_data["recentHealthRecords"] = list(
|
| 71 |
db.health_records.find({"farm_id": user_farm_id})
|
| 72 |
.sort("diagnosis_date", -1)
|
|
|
|
| 63 |
|
| 64 |
# Recent tasks and health records (admin)
|
| 65 |
response_data["recentTasks"] = list(
|
| 66 |
+
db.tasks.find(
|
| 67 |
+
{}, # No filter, match all documents
|
| 68 |
+
{"task_description": 1, "due_date": 1, "_id": 0} # Projection
|
| 69 |
+
)
|
| 70 |
+
.sort("created_at", -1) # Sort by "created_at" in descending order
|
| 71 |
+
.limit(5) # Limit to 5 documents
|
| 72 |
)
|
| 73 |
+
|
| 74 |
response_data["recentHealthRecords"] = list(
|
| 75 |
db.health_records.find({"farm_id": user_farm_id})
|
| 76 |
.sort("diagnosis_date", -1)
|
backend/app/templates/main/partials/navbar.html
CHANGED
|
@@ -14,6 +14,9 @@
|
|
| 14 |
<li class="nav-item">
|
| 15 |
<a class="nav-link" href="/chat">Chatbot</a>
|
| 16 |
</li>
|
|
|
|
|
|
|
|
|
|
| 17 |
</ul>
|
| 18 |
<!--end::Start Navbar Links-->
|
| 19 |
|
|
|
|
| 14 |
<li class="nav-item">
|
| 15 |
<a class="nav-link" href="/chat">Chatbot</a>
|
| 16 |
</li>
|
| 17 |
+
<li class="nav-item">
|
| 18 |
+
<a class="nav-link" href="/docs">Swaggerui</a>
|
| 19 |
+
</li>
|
| 20 |
</ul>
|
| 21 |
<!--end::Start Navbar Links-->
|
| 22 |
|