h
This commit is contained in:
@@ -145,10 +145,16 @@ class KIChat {
|
||||
this.isTyping = true;
|
||||
|
||||
try {
|
||||
const response = await fetch('/scripts/add/send.php', {
|
||||
// Use relative path that works from any page location
|
||||
const basePath = window.location.pathname.includes('/') ?
|
||||
window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1) : '/';
|
||||
const apiUrl = new URL('/scripts/add/send.php', window.location.origin).href;
|
||||
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
type: 'chat',
|
||||
|
||||
Reference in New Issue
Block a user