chore: remove used crud for webpush settings (#2719)

This commit is contained in:
dni ⚡ 2024-09-27 08:35:33 +02:00 committed by GitHub
parent 3ac6bc3c3b
commit 75bcbdc18d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,6 @@ from lnbits.settings import (
AdminSettings,
EditableSettings,
SuperSettings,
WebPushSettings,
settings,
)
@ -1255,24 +1254,6 @@ async def delete_tinyurl(tinyurl_id: str):
# -----------------
async def get_webpush_settings() -> Optional[WebPushSettings]:
row = await db.fetchone("SELECT * FROM webpush_settings")
if not row:
return None
vapid_keypair = json.loads(row["vapid_keypair"])
return WebPushSettings(**vapid_keypair)
async def create_webpush_settings(webpush_settings: dict):
await db.execute(
"INSERT INTO webpush_settings (vapid_keypair) VALUES (:vapid_keypair)",
{
"vapid_keypair": json.dumps(webpush_settings),
},
)
return await get_webpush_settings()
async def get_webpush_subscription(
endpoint: str, user: str
) -> Optional[WebPushSubscription]: