create an initialising event fro compose

This commit is contained in:
Ben Arc 2021-04-20 10:34:48 +01:00
parent b520d0d8b2
commit 25c2d2c7c6
2 changed files with 22 additions and 1 deletions

View file

@ -154,7 +154,16 @@
this.initCamera()
},
created: function () {
console.log('{{ copilot.id }}')
LNbits.api
.request(
'GET',
'/api/v1/copilot/ws/{{ copilot.id }}/initialising/rocket',
'filla'
)
.then(function (response) {})
.catch(function (error) {
LNbits.utils.notifyApiError(error)
})
if (location.protocol !== 'http:') {
this.connection = new WebSocket(
'wss://' +

View file

@ -5,6 +5,7 @@ import httpx
from lnbits.core.crud import get_user
from lnbits.decorators import api_check_wallet_key, api_validate_post_request
from .views import updater
from . import copilot_ext
@ -91,3 +92,14 @@ async def api_copilot_delete(copilot_id):
await delete_copilot(copilot_id)
return "", HTTPStatus.NO_CONTENT
@copilot_ext.route("/api/v1/copilot/ws/<copilot_id>/<comment>/<data>", methods=["GET"])
async def api_copilot_retrieve(copilot_id, comment, data):
copilot = await get_copilot(copilot_id)
if not copilot:
return jsonify({"message": "copilot does not exist"}), HTTPStatus.NOT_FOUND
await updater(data, comment, copilot_id)
return "", HTTPStatus.OK