From 8be5662c31a39645c8b2752bb3c9787a177380b7 Mon Sep 17 00:00:00 2001 From: Veronica Valeros Date: Sun, 29 Sep 2024 20:23:38 +0200 Subject: [PATCH] Update MessageList.js --- src/components/MessageList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MessageList.js b/src/components/MessageList.js index 2e5cd68..e2214a2 100644 --- a/src/components/MessageList.js +++ b/src/components/MessageList.js @@ -26,7 +26,7 @@ const MessageList = () => { useEffect(() => { const fetchMessages = async () => { try { - const response = await axios.get('/api/messages'); + const response = await axios.get(`${window.location.origin}/api/messages.json`); setMessages(response.data); } catch (err) { setError('Failed to fetch messages.');