This commit is contained in:
2026-02-19 11:45:25 +01:00
parent a8caee15f9
commit c718f15f09
9 changed files with 129 additions and 239 deletions

View File

@@ -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',