patchnotes controller updated

This commit is contained in:
Justin Weins 2025-06-25 12:59:56 +02:00
parent b6cfe62724
commit 4df2a1dede
1 changed files with 12 additions and 2 deletions

View File

@ -127,8 +127,18 @@ def list_patchnotes(since: str | None = None):
# 2) Wenn ?since fehlt, gespeichertes last_login holen # 2) Wenn ?since fehlt, gespeichertes last_login holen
if since is None: if since is None:
rec = last_login_collection.find_one({"user_id": user_id}) try:
since = rec["last_login"] if rec else None docs = list(collection.sort("patch_date", 1))
for d in docs:
d.pop("_id", None)
if isinstance(d["patch_date"], (datetime, date)):
d["patch_date"] = d["patch_date"].isoformat()
except ValueError as e:
raise ProblemException(
title="Internal Server Error",
detail=str(e),
status=500,
)
# 3) Datum validieren (nur wenn vorhanden) # 3) Datum validieren (nur wenn vorhanden)
if since: if since: