Fix: Replace hardcoded localhost API URL with env var
Browse files
frontend/src/components/ChatPanel.tsx
CHANGED
|
@@ -479,7 +479,8 @@ export default function ChatPanel({ onMapUpdate, layers = [] }: ChatPanelProps)
|
|
| 479 |
|
| 480 |
try {
|
| 481 |
const history = messages.map(m => ({ role: m.role, content: m.content }));
|
| 482 |
-
const
|
|
|
|
| 483 |
method: "POST",
|
| 484 |
headers: { "Content-Type": "application/json" },
|
| 485 |
body: JSON.stringify({ message: fullMessage, history }) // Send ID-enriched message
|
|
|
|
| 479 |
|
| 480 |
try {
|
| 481 |
const history = messages.map(m => ({ role: m.role, content: m.content }));
|
| 482 |
+
const apiUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000/api/v1";
|
| 483 |
+
const response = await fetch(`${apiUrl}/chat/stream`, {
|
| 484 |
method: "POST",
|
| 485 |
headers: { "Content-Type": "application/json" },
|
| 486 |
body: JSON.stringify({ message: fullMessage, history }) // Send ID-enriched message
|