This commit is contained in:
Aevann1 2021-11-11 02:26:25 +02:00
parent fcbfdd7d79
commit 9424d8c2a5
2 changed files with 12 additions and 2 deletions

View file

@ -11,6 +11,15 @@ SITE_NAME = environ.get("SITE_NAME", "").strip()
def slash_post():
return redirect("/")
@app.post("/clear")
@auth_required
def clear(v):
for n in v.notifications.filter_by(read=False).all():
n.read = True
g.db.add(n)
g.db.commit()
return {"message": "Notifications cleared!"}
@app.get("/notifications")
@auth_required
def notifications(v):