make "clear all notifications" button also clear post notifs

remotes/1693045480750635534/spooky-22
Aevann1 2022-07-08 21:33:26 +02:00
parent 6deb1cf0a4
commit f298d134ac
1 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,7 @@ from files.helpers.wrappers import *
from files.helpers.get import *
from files.helpers.const import *
from files.__main__ import app
import time
@app.post("/clear")
@auth_required
@ -11,6 +11,8 @@ def clear(v):
for n in notifs:
n.read = True
g.db.add(n)
v.last_viewed_post_notifs = int(time.time())
g.db.add(v)
return {"message": "Notifications cleared!"}