checks before creating new subdomain
This commit is contained in:
@@ -4,8 +4,6 @@ from lnbits.helpers import urlsafe_short_hash
|
||||
|
||||
from . import db
|
||||
from .models import Domains, Subdomains
|
||||
import httpx
|
||||
|
||||
from lnbits.extensions import subdomains
|
||||
|
||||
|
||||
@@ -73,6 +71,14 @@ async def get_subdomain(subdomain_id: str) -> Optional[Subdomains]:
|
||||
print(row)
|
||||
return Subdomains(**row) if row else None
|
||||
|
||||
async def get_subdomainBySubdomain(subdomain: str) -> Optional[Subdomains]:
|
||||
row = await db.fetchone(
|
||||
"SELECT s.*, d.domain as domain_name FROM subdomain s INNER JOIN domain d ON (s.domain = d.id) WHERE s.subdomain = ?",
|
||||
(subdomain, ),
|
||||
)
|
||||
print(row)
|
||||
return Subdomains(**row) if row else None
|
||||
|
||||
|
||||
async def get_subdomains(wallet_ids: Union[str, List[str]]) -> List[Subdomains]:
|
||||
if isinstance(wallet_ids, str):
|
||||
|
||||
Reference in New Issue
Block a user