chore: remove used crud for webpush settings (#2719)
This commit is contained in:
parent
3ac6bc3c3b
commit
75bcbdc18d
1 changed files with 0 additions and 19 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue