x
This commit is contained in:
@@ -732,6 +732,18 @@ if (!$data || empty($data)) {
|
|||||||
|
|
||||||
$requestType = $data['type'] ?? 'contact';
|
$requestType = $data['type'] ?? 'contact';
|
||||||
|
|
||||||
|
// Debug endpoint to test webhook connectivity
|
||||||
|
if ($requestType === 'test_webhook') {
|
||||||
|
$testData = ['test' => true, 'timestamp' => date('c')];
|
||||||
|
$result = sendToWebhook($testData, KI_CHAT_WEBHOOK_URL);
|
||||||
|
sendResponse(true, 'Webhook test completed', [
|
||||||
|
'webhook_url' => KI_CHAT_WEBHOOK_URL,
|
||||||
|
'result' => $result,
|
||||||
|
'curl_available' => function_exists('curl_init'),
|
||||||
|
'allow_url_fopen' => ini_get('allow_url_fopen')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
switch ($requestType) {
|
switch ($requestType) {
|
||||||
case 'contact':
|
case 'contact':
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class DemoChat {
|
|||||||
|
|
||||||
console.log('Demo Chat: Response status', response.status);
|
console.log('Demo Chat: Response status', response.status);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log('Demo Chat: Response data', data);
|
console.log('Demo Chat: Response data', JSON.stringify(data, null, 2));
|
||||||
|
|
||||||
if (data.success && data.data && data.data.ai_response) {
|
if (data.success && data.data && data.data.ai_response) {
|
||||||
this.addMessageToUI('ki', data.data.ai_response);
|
this.addMessageToUI('ki', data.data.ai_response);
|
||||||
|
|||||||
Reference in New Issue
Block a user