Allererste Fassung von Gruppen- und Dispatcher-Mobil View

This commit is contained in:
concierge committed 2026-10-28 14:23:15 +01:00
1 parent 47240302d0
commit 8e5f91948f
9 files changed
+1383 -20

No files matched your search

+26
View File
@@ -11,6 +11,32 @@ from cmbnet.services.groups_service import GroupsService
api_init_bp = Blueprint('api_init', __name__)
@api_init_bp.route('/init/me')
@login_required
def init_me(**kwargs):
account = getattr(g, 'current_account', None)
if not account:
return jsonify({'id': None, 'role': None, 'name': None})
return jsonify({
'id': account['id'],
'role': account['role'],
'name': account['name'],
'tenant_id': account['tenant_id'],
'tenant_code': account['tenant_code']
})
@api_init_bp.route('/init/groups/<int:group_id>/streets')
@login_required
def init_group_streets(group_id, **kwargs):
from cmbnet.services.groups_service import GroupsService
streets = GroupsService.get_streets_for_group(group_id, g.tenant_id)
result = []
for street in streets:
result.append(dict(street))
return jsonify(result)
@api_init_bp.route('/init/accounts')
@login_required
def init_accounts(**kwargs):