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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user