mirror of
https://github.com/lnbits/lnbits.git
synced 2025-04-02 08:58:33 +02:00
chore: remove used crud for webpush settings (#2719)
This commit is contained in:
parent
3ac6bc3c3b
commit
75bcbdc18d
@ -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]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user