mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-20 13:04:23 +02:00
few bugs
This commit is contained in:
@@ -15,7 +15,7 @@ from quart import jsonify
|
|||||||
async def create_copilot(
|
async def create_copilot(
|
||||||
title: str,
|
title: str,
|
||||||
user: str,
|
user: str,
|
||||||
lnurl_toggle: str,
|
lnurl_toggle: Optional[int] = 0,
|
||||||
wallet: Optional[str] = None,
|
wallet: Optional[str] = None,
|
||||||
animation1: Optional[str] = None,
|
animation1: Optional[str] = None,
|
||||||
animation2: Optional[str] = None,
|
animation2: Optional[str] = None,
|
||||||
|
@@ -23,7 +23,7 @@ async def m001_initial(db):
|
|||||||
lnurl_title TEXT,
|
lnurl_title TEXT,
|
||||||
show_message INTEGER,
|
show_message INTEGER,
|
||||||
show_ack INTEGER,
|
show_ack INTEGER,
|
||||||
show_price TEXT,
|
show_price INTEGER,
|
||||||
amount_made INTEGER,
|
amount_made INTEGER,
|
||||||
fullscreen_cam INTEGER,
|
fullscreen_cam INTEGER,
|
||||||
iframe_url TEXT,
|
iframe_url TEXT,
|
||||||
|
@@ -11,7 +11,7 @@ class Copilots(NamedTuple):
|
|||||||
id: str
|
id: str
|
||||||
user: str
|
user: str
|
||||||
title: str
|
title: str
|
||||||
lnurl_toggle: str
|
lnurl_toggle: int
|
||||||
wallet: str
|
wallet: str
|
||||||
animation1: str
|
animation1: str
|
||||||
animation2: str
|
animation2: str
|
||||||
@@ -25,7 +25,7 @@ class Copilots(NamedTuple):
|
|||||||
lnurl_title: str
|
lnurl_title: str
|
||||||
show_message: int
|
show_message: int
|
||||||
show_ack: int
|
show_ack: int
|
||||||
show_price: str
|
show_price: int
|
||||||
amount_made: int
|
amount_made: int
|
||||||
timestamp: int
|
timestamp: int
|
||||||
fullscreen_cam: int
|
fullscreen_cam: int
|
||||||
|
@@ -494,8 +494,25 @@
|
|||||||
|
|
||||||
createCopilot: function (wallet, data) {
|
createCopilot: function (wallet, data) {
|
||||||
var self = this
|
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
|
LNbits.api
|
||||||
.request('POST', '/copilot/api/v1/copilot', wallet, data)
|
.request('POST', '/copilot/api/v1/copilot', wallet, updatedData)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
self.CopilotLinks.push(mapCopilot(response.data))
|
self.CopilotLinks.push(mapCopilot(response.data))
|
||||||
self.formDialogCopilot.show = false
|
self.formDialogCopilot.show = false
|
||||||
|
Reference in New Issue
Block a user