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, AdminSettings,
EditableSettings, EditableSettings,
SuperSettings, SuperSettings,
WebPushSettings,
settings, 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( async def get_webpush_subscription(
endpoint: str, user: str endpoint: str, user: str
) -> Optional[WebPushSubscription]: ) -> Optional[WebPushSubscription]: