Refactor API URLs and add environment config example
Replaces hardcoded production API URLs with localhost defaults for local development in both server and client code. Updates Dockerfile to require API URLs via deployment environment variables. Improves ChatTable to use a batch endpoint for chats and unread counts, with backward compatibility. Adds an env.example file to document required environment variables. Updates next.config.mjs to use environment variables for backend API rewrites and image domains.
This commit is contained in:
@@ -213,7 +213,9 @@ export default function ChatDetail({ chatId }: { chatId: string }) {
|
||||
try {
|
||||
setLoading(true);
|
||||
|
||||
// Use clientFetch instead of direct axios calls
|
||||
// Use clientFetch to load chat data
|
||||
// For now, we're only loading chat data, but this could be extended
|
||||
// to load additional data in parallel (user profiles, order details, etc.)
|
||||
const response = await clientFetch(`/chats/${chatId}`);
|
||||
|
||||
setChatData(response);
|
||||
|
||||
Reference in New Issue
Block a user