fix(frontend): use /api/proxy/ prefix for search_users and tier fetch calls

The generated API hooks use /api/proxy/ as baseUrl. Raw fetch() calls
must use the same proxy path to reach the backend through Next.js.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zamil Majdy
2026-03-28 16:32:52 +00:00
parent 18c5f67107
commit a85ba9e36d

View File

@@ -86,7 +86,7 @@ export function useRateLimitManager() {
try {
const response = await fetch(
`/api/copilot/admin/rate_limit/search_users?query=${encodeURIComponent(trimmed)}&limit=20`,
`/api/proxy/copilot/admin/rate_limit/search_users?query=${encodeURIComponent(trimmed)}&limit=20`,
);
if (!response.ok) {
throw new Error("Failed to search users");
@@ -181,7 +181,7 @@ export function useRateLimitManager() {
async function handleTierChange(newTier: string) {
if (!rateLimitData) return;
const response = await fetch("/api/copilot/admin/rate_limit/tier", {
const response = await fetch("/api/proxy/copilot/admin/rate_limit/tier", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({