update listy jak sie zmieni
This commit is contained in:
19
app.py
19
app.py
@@ -1141,7 +1141,7 @@ def handle_join(data):
|
||||
emit('user_joined', {'username': username}, to=room)
|
||||
emit('user_list', {'users': list(active_users[room])}, to=room)
|
||||
emit('joined_confirmation', {'room': room, 'list_title': list_title})
|
||||
|
||||
|
||||
@socketio.on('disconnect')
|
||||
def handle_disconnect(sid):
|
||||
global active_users
|
||||
@@ -1220,6 +1220,23 @@ def handle_uncheck_item(data):
|
||||
'percent': percent
|
||||
}, to=str(item.list_id))
|
||||
|
||||
@socketio.on('request_full_list')
|
||||
def handle_request_full_list(data):
|
||||
list_id = data['list_id']
|
||||
items = Item.query.filter_by(list_id=list_id).all()
|
||||
|
||||
items_data = []
|
||||
for item in items:
|
||||
items_data.append({
|
||||
'id': item.id,
|
||||
'name': item.name,
|
||||
'quantity': item.quantity,
|
||||
'purchased': item.purchased,
|
||||
'note': item.note or ''
|
||||
})
|
||||
|
||||
emit('full_list', {'items': items_data}, to=request.sid)
|
||||
|
||||
@socketio.on('update_note')
|
||||
def handle_update_note(data):
|
||||
item_id = data['item_id']
|
||||
|
Reference in New Issue
Block a user