fix satsdice update

This commit is contained in:
Tiago vasconcelos 2021-11-04 16:41:23 +00:00
parent f220797a35
commit 1718e3d804
2 changed files with 13 additions and 11 deletions

View File

@ -1,15 +1,16 @@
import json
from lnurl import Lnurl, LnurlWithdrawResponse, encode as lnurl_encode # type: ignore
from urllib.parse import urlparse, urlunparse, parse_qs, urlencode, ParseResult
from lnurl.types import LnurlPayMetadata # type: ignore
from sqlite3 import Row
from typing import NamedTuple, Optional, Dict
from typing import Dict, NamedTuple, Optional
from urllib.parse import ParseResult, parse_qs, urlencode, urlparse, urlunparse
import shortuuid # type: ignore
from fastapi.param_functions import Query
from pydantic.main import BaseModel
from pydantic import BaseModel
from typing import Optional
from fastapi import FastAPI, Request
from fastapi.param_functions import Query
from lnurl import Lnurl, LnurlWithdrawResponse
from lnurl import encode as lnurl_encode # type: ignore
from lnurl.types import LnurlPayMetadata # type: ignore
from pydantic import BaseModel
from pydantic.main import BaseModel
class satsdiceLink(BaseModel):
@ -105,7 +106,7 @@ class HashCheck(BaseModel):
class CreateSatsDiceLink(BaseModel):
wallet_id: str = Query(None)
wallet: str = Query(None)
title: str = Query(None)
base_url: str = Query(None)
min_bet: str = Query(None)

View File

@ -22,7 +22,7 @@ from .crud import (
update_satsdice_pay,
update_satsdice_withdraw,
)
from .models import CreateSatsDiceLink, CreateSatsDiceWithdraws
from .models import CreateSatsDiceLink, CreateSatsDiceWithdraws, satsdiceLink
################LNURL pay
@ -92,7 +92,8 @@ async def api_link_create_or_update(
detail="Come on, seriously, this isn't your satsdice!",
)
data.wallet_id = wallet.wallet.id
data.wallet = wallet.wallet.id
link = await update_satsdice_pay(link_id, **data.dict())
else:
link = await create_satsdice_pay(wallet_id=wallet.wallet.id, data=data)