Nachrichten klappen jetzt einigermassen

This commit is contained in:
concierge committed 2026-10-25 09:59:37 +01:00
1 parent 518248ca00
commit ffdb399f9e
5 files changed
+551 -69

No files matched your search

+16
View File
@@ -4,12 +4,28 @@ API Endpunkte für Initialdaten
from flask import Blueprint, jsonify, g, request
from cmbnet.auth import login_required
from cmbnet.db import get_db
from cmbnet.models.accounts import AccountModel
from cmbnet.services.streets_service import StreetsService
from cmbnet.services.groups_service import GroupsService
api_init_bp = Blueprint('api_init', __name__)
@api_init_bp.route('/init/accounts')
@login_required
def init_accounts(**kwargs):
"""Liefert alle Accounts für den Tenant (für Senderdarstellung)"""
accounts = AccountModel.get_all_by_tenant(g.tenant_id)
result = []
for account in accounts:
result.append({
'id': account['id'],
'name': account['name'],
'role': account['role']
})
return jsonify(result)
@api_init_bp.route('/init/streets')
@login_required
def init_streets(**kwargs):