mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user