group color shown in CustomEventModal

add functionality for edit of events
This commit is contained in:
2025-07-24 07:43:32 +00:00
parent b0e933e895
commit 4e6451ce80
7 changed files with 215 additions and 30 deletions

View File

@@ -163,3 +163,21 @@ def find_by_filename():
'file_path': media.file_path,
'url': media.url
})
@eventmedia_bp.route('/<int:media_id>', methods=['GET'])
def get_media_by_id(media_id):
session = Session()
media = session.query(EventMedia).get(media_id)
if not media:
session.close()
return jsonify({'error': 'Not found'}), 404
result = {
'id': media.id,
'file_path': media.file_path,
'url': media.url,
'name': media.url, # oder ein anderes Feld für den Namen
'media_type': media.media_type.name if media.media_type else None
}
session.close()
return jsonify(result)