summaryrefslogtreecommitdiff
path: root/backend/notif.py
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2025-12-30 00:03:40 +0800
committeraltaf-creator <dev@altafcreator.com>2025-12-30 00:03:40 +0800
commitb1c986bde9a45942a56e3f8de68a76e599ad9b02 (patch)
tree372582fc5c6d74202a9605433624f438166ef7ea /backend/notif.py
parent68842e3654895fd1abd565445de82b7248280f31 (diff)
some more debug
Diffstat (limited to 'backend/notif.py')
-rw-r--r--backend/notif.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/backend/notif.py b/backend/notif.py
index 15977a0..8de4d4c 100644
--- a/backend/notif.py
+++ b/backend/notif.py
@@ -27,15 +27,22 @@ CREATE TABLE IF NOT EXISTS subscriptions (
# --- subscribe
def subscribe(data: PushSubscriptionData):
cursor.execute("SELECT * FROM subscriptions WHERE endpoint = ?", (data.endpoint,))
- row = cursor.fetchall()
+ result = cursor.fetchall()
- if len(row) > 0:
+ if len(result) > 0:
return data.endpoint
cursor.execute("""
INSERT INTO subscriptions (endpoint, keys_p256dh, keys_auth)
VALUES (?, ?, ?)""", (data.endpoint, data.keys["p256dh"], data.keys["auth"]))
conn.commit()
+
+ cursor.execute("SELECT * FROM subscriptions");
+ result = cursor.fetchall()
+
+ for row in result:
+ print(row)
+
return data.endpoint