From 2d396b0c124362c6e0624469caa8dc5cfe836ec5 Mon Sep 17 00:00:00 2001 From: Hussain Omer Date: Sat, 14 Dec 2024 18:04:34 -0500 Subject: [PATCH] Fixes #150: Productivity Assistant --- client/src/components/AI/Chat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/AI/Chat.js b/client/src/components/AI/Chat.js index fc3d86d..95aa239 100644 --- a/client/src/components/AI/Chat.js +++ b/client/src/components/AI/Chat.js @@ -63,7 +63,8 @@ const Chat = ({ isOpen, onClose, isAuthenticated }) => { .slice(-2); try { - const response = await fetch(`${process.env.REACT_APP_PROD || 'http://localhost:3001'}/api/ai/chat`, { + const API_BASE_URL = process.env.REACT_APP_PROD || 'http://localhost:3001/api'; + const response = await fetch(`${API_BASE_URL}/ai/chat`, { method: 'POST', headers: { 'Content-Type': 'application/json',