Chat client changes

- Form values shown correct in MessageHistory of Chat client
- Improements to CSS
- Move css en js to assets directory
- Introduce better Personal Contact Form & Professional Contact Form
- Start working on actual Selection Specialist
This commit is contained in:
Josako
2025-06-15 05:25:00 +02:00
parent 3c7460f741
commit 82e25b356c
27 changed files with 1077 additions and 161 deletions

View File

@@ -117,10 +117,12 @@ def send_message():
"""
try:
data = request.json
message = data.get('message')
message = data.get('message', '')
form_values = data.get('form_values', {})
if not message:
return jsonify({'error': 'No message provided'}), 400
# Controleer of er ofwel een bericht of formuliergegevens zijn
if not message and not form_values:
return jsonify({'error': 'No message or form data provided'}), 400
tenant_id = session['tenant']['id']
specialist_id = session['specialist']['id']
@@ -134,7 +136,12 @@ def send_message():
Database(tenant_id).switch_schema()
# Add user message to specialist arguments
specialist_args['question'] = message
if message:
specialist_args['question'] = message
# Add form values to specialist arguments if present
if form_values:
specialist_args['form_values'] = form_values
current_app.logger.debug(f"Sending message to specialist: {specialist_id} for tenant {tenant_id}\n"
f" with args: {specialist_args}\n"