introduce icons in events
This commit is contained in:
@@ -9,6 +9,17 @@ sys.path.append('/workspace')
|
||||
events_bp = Blueprint("events", __name__, url_prefix="/api/events")
|
||||
|
||||
|
||||
def get_icon_for_type(event_type):
|
||||
# Lucide-Icon-Namen als String
|
||||
return {
|
||||
"presentation": "Presentation", # <--- geändert!
|
||||
"website": "Globe",
|
||||
"video": "Video",
|
||||
"message": "MessageSquare",
|
||||
"webuntis": "School",
|
||||
}.get(event_type, "")
|
||||
|
||||
|
||||
@events_bp.route("", methods=["GET"])
|
||||
def get_events():
|
||||
session = Session()
|
||||
@@ -45,6 +56,8 @@ def get_events():
|
||||
"EndTime": e.end.isoformat() if e.end else None,
|
||||
"IsAllDay": False,
|
||||
"MediaId": e.event_media_id,
|
||||
"Type": e.event_type.value if e.event_type else None, # <-- Enum zu String!
|
||||
"Icon": get_icon_for_type(e.event_type.value if e.event_type else None),
|
||||
})
|
||||
session.close()
|
||||
return jsonify(result)
|
||||
|
||||
Reference in New Issue
Block a user