Skip to content

Commit bca37fe

Browse files
eypsilonclaude
andcommitted
Fix message action fetch URL routing
Update second fetch call (message actions) to use window.location.pathname instead of hardcoded get.php path. Ensures all API calls route through the unified entry point. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent fe34947 commit bca37fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

example/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// If this is a POST request, handle it as an API call
88
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
9-
require __DIR__ . '/get.php';
9+
require_once dirname(__FILE__) . '/get.php';
1010
exit;
1111
}
1212

@@ -1573,7 +1573,7 @@ classes.push('message--answered');
15731573
}
15741574

15751575
try {
1576-
const response = await fetch(`get.php?message=${encodeURIComponent(uid)}&action=${encodeURIComponent(action)}`, {
1576+
const response = await fetch(`${window.location.pathname}?message=${encodeURIComponent(uid)}&action=${encodeURIComponent(action)}`, {
15771577
method: 'POST',
15781578
body: payload,
15791579
});

0 commit comments

Comments
 (0)