diff --git a/lnbits/extensions/diagonalley/crud.py b/lnbits/extensions/diagonalley/crud.py index 8dadb739..f9601732 100644 --- a/lnbits/extensions/diagonalley/crud.py +++ b/lnbits/extensions/diagonalley/crud.py @@ -192,7 +192,6 @@ async def get_diagonalley_stall(stall_id: str) -> Optional[Stalls]: row = await db.fetchone( "SELECT * FROM diagonalley.stalls WHERE id = ?", (stall_id,) ) - print("ROW", row) return Stalls(**row) if row else None @@ -305,6 +304,20 @@ async def set_diagonalley_order_paid(payment_hash: str) -> Orders: ) +async def set_diagonalley_order_pubkey(payment_hash: str, pubkey: str): + await db.execute( + """ + UPDATE diagonalley.orders + SET pubkey = ? + WHERE invoiceid = ? + """, + ( + pubkey, + payment_hash, + ), + ) + + async def update_diagonalley_product_stock(products): q = "\n".join( @@ -413,7 +426,6 @@ async def update_diagonalley_market(market_id): async def create_chat_message(data: CreateChatMessage): - print("DATA", data) await db.execute( """ INSERT INTO diagonalley.messages (msg, pubkey, id_conversation) @@ -452,5 +464,4 @@ async def get_diagonalley_chat_by_merchant(ids: List[str]) -> List[ChatMessage]: f"SELECT * FROM diagonalley.messages WHERE id_conversation IN ({q})", (*ids,), ) - print(ids, q, rows) return [ChatMessage(**row) for row in rows] diff --git a/lnbits/extensions/diagonalley/notifier.py b/lnbits/extensions/diagonalley/notifier.py index 08badfc7..f99cc4bf 100644 --- a/lnbits/extensions/diagonalley/notifier.py +++ b/lnbits/extensions/diagonalley/notifier.py @@ -80,9 +80,7 @@ class Notifier: """Notifier""" d = json.loads(message) d["room_name"] = room_name - print("hey", d) db_msg = CreateChatMessage.parse_obj(d) - print("NOT:", db_msg) await create_chat_message(data=db_msg) remaining_sessions = [] diff --git a/lnbits/extensions/diagonalley/templates/diagonalley/index.html b/lnbits/extensions/diagonalley/templates/diagonalley/index.html index 435735ad..5c9b26cc 100644 --- a/lnbits/extensions/diagonalley/templates/diagonalley/index.html +++ b/lnbits/extensions/diagonalley/templates/diagonalley/index.html @@ -859,9 +859,10 @@
@@ -1787,7 +1788,6 @@ .then(response => { if (response.data) { this.markets = response.data.map(mapMarkets) - // console.log(this.markets) } }) .catch(error => { @@ -1904,7 +1904,7 @@ LNbits.utils.notifyApiError(error) }) }, - createOrder: function () { + /*createOrder: function () { var data = { address: this.orderDialog.data.address, email: this.orderDialog.data.email, @@ -1929,7 +1929,7 @@ .catch(function (error) { LNbits.utils.notifyApiError(error) }) - }, + },*/ deleteOrder: function (orderId) { var self = this var order = _.findWhere(self.orders, {id: orderId}) @@ -1941,7 +1941,7 @@ .request( 'DELETE', '/diagonalley/api/v1/orders/' + orderId, - _.findWhere(self.g.user.wallets, {id: order.wallet}).inkey + _.findWhere(self.g.user.wallets, {id: order.wallet}).adminkey ) .then(function (response) { self.orders = _.reject(self.orders, function (obj) { @@ -1961,7 +1961,6 @@ this.g.user.wallets[0].inkey ) .then(response => { - console.log(response.data) this.orders = _.reject(this.orders, obj => { return obj.id == order_id }) @@ -1987,7 +1986,6 @@ .then(res => { this.messages = _.groupBy(res.data, 'id_conversation') this.checkUnreadMessages() - console.log('Get new messages!') }) .catch(error => { LNbits.utils.notifyApiError(error) @@ -2005,7 +2003,6 @@ ] } } - //console.log({chat}) this.$q.localStorage.set(`lnbits.diagonalley.${this.g.user.id}`, { ...data, chat @@ -2031,7 +2028,6 @@ } else { this.$set(this.orders[idx], 'unread', false) } - console.log('Order:', this.orders[idx]) } }, clearMessage() { @@ -2122,6 +2118,11 @@ })