Update main.py
Browse files
main.py
CHANGED
|
@@ -32,7 +32,7 @@ async def generate_report(request: ReportRequest):
|
|
| 32 |
userid = request.user_id
|
| 33 |
username = request.username
|
| 34 |
journalcollection = get_mongo_collection()
|
| 35 |
-
cursor = journalcollection.find({"userId":userid}).sort("createdAt",
|
| 36 |
original = ""
|
| 37 |
for item in cursor:
|
| 38 |
if item["content"].get("mind_dump") is True:
|
|
@@ -59,4 +59,4 @@ async def generate_report(request: ReportRequest):
|
|
| 59 |
raise HTTPException(status_code=500, detail=str(e))
|
| 60 |
|
| 61 |
if __name__ == "__main__":
|
| 62 |
-
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
|
|
| 32 |
userid = request.user_id
|
| 33 |
username = request.username
|
| 34 |
journalcollection = get_mongo_collection()
|
| 35 |
+
cursor = journalcollection.find({"type":"mind_dump","userId":userid}).sort("createdAt",-1).limit(1)
|
| 36 |
original = ""
|
| 37 |
for item in cursor:
|
| 38 |
if item["content"].get("mind_dump") is True:
|
|
|
|
| 59 |
raise HTTPException(status_code=500, detail=str(e))
|
| 60 |
|
| 61 |
if __name__ == "__main__":
|
| 62 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|