few bugs
This commit is contained in:
parent
2bc3fb1b91
commit
137f8a7519
|
@ -15,7 +15,7 @@ from quart import jsonify
|
|||
async def create_copilot(
|
||||
title: str,
|
||||
user: str,
|
||||
lnurl_toggle: str,
|
||||
lnurl_toggle: Optional[int] = 0,
|
||||
wallet: Optional[str] = None,
|
||||
animation1: Optional[str] = None,
|
||||
animation2: Optional[str] = None,
|
||||
|
|
|
@ -23,7 +23,7 @@ async def m001_initial(db):
|
|||
lnurl_title TEXT,
|
||||
show_message INTEGER,
|
||||
show_ack INTEGER,
|
||||
show_price TEXT,
|
||||
show_price INTEGER,
|
||||
amount_made INTEGER,
|
||||
fullscreen_cam INTEGER,
|
||||
iframe_url TEXT,
|
||||
|
|
|
@ -11,7 +11,7 @@ class Copilots(NamedTuple):
|
|||
id: str
|
||||
user: str
|
||||
title: str
|
||||
lnurl_toggle: str
|
||||
lnurl_toggle: int
|
||||
wallet: str
|
||||
animation1: str
|
||||
animation2: str
|
||||
|
@ -25,7 +25,7 @@ class Copilots(NamedTuple):
|
|||
lnurl_title: str
|
||||
show_message: int
|
||||
show_ack: int
|
||||
show_price: str
|
||||
show_price: int
|
||||
amount_made: int
|
||||
timestamp: int
|
||||
fullscreen_cam: int
|
||||
|
|
|
@ -494,8 +494,25 @@
|
|||
|
||||
createCopilot: function (wallet, data) {
|
||||
var self = this
|
||||
var updatedData = {}
|
||||
for (const property in data) {
|
||||
if (data[property]) {
|
||||
updatedData[property] = data[property]
|
||||
}
|
||||
if (property == 'animation1threshold' && data[property]) {
|
||||
console.log(data[property])
|
||||
updatedData[property] = parseInt(data[property])
|
||||
}
|
||||
if (property == 'animation2threshold' && data[property]) {
|
||||
updatedData[property] = parseInt(data[property])
|
||||
}
|
||||
if (property == 'animation3threshold' && data[property]) {
|
||||
updatedData[property] = parseInt(data[property])
|
||||
}
|
||||
}
|
||||
console.log(updatedData)
|
||||
LNbits.api
|
||||
.request('POST', '/copilot/api/v1/copilot', wallet, data)
|
||||
.request('POST', '/copilot/api/v1/copilot', wallet, updatedData)
|
||||
.then(function (response) {
|
||||
self.CopilotLinks.push(mapCopilot(response.data))
|
||||
self.formDialogCopilot.show = false
|
||||
|
|
Loading…
Reference in New Issue
Block a user