From 990d79a5c740beb32dccce0ba333a0132254283a Mon Sep 17 00:00:00 2001 From: Sean Date: Wed, 12 Jun 2024 20:16:54 -0400 Subject: [PATCH] CHE-130 Updated logic to handle edit save if no forum as been selected --- .../src/components/Forums/ThreadsDisplay/ThreadsDisplay.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/components/Forums/ThreadsDisplay/ThreadsDisplay.tsx b/client/src/components/Forums/ThreadsDisplay/ThreadsDisplay.tsx index 8fd6810..1740bc3 100644 --- a/client/src/components/Forums/ThreadsDisplay/ThreadsDisplay.tsx +++ b/client/src/components/Forums/ThreadsDisplay/ThreadsDisplay.tsx @@ -65,13 +65,13 @@ const ThreadsDisplay = ({ forumId, onThreadSelect }: ThreadsDisplayProps) => { const handleUpdateThread = async ( event: React.MouseEvent, threadId: string, + forum: string, ) => { event.stopPropagation(); setLoading(true); try { - console.log('handleUpdateThread HIT: '); await axios.put( - `/api/forums/${forumId}/threads/${threadId}`, + `/api/forums/${forumId || forum}/threads/${threadId}`, { title: editTitle, content: editContent }, { withCredentials: true }, ); @@ -134,7 +134,7 @@ const ThreadsDisplay = ({ forumId, onThreadSelect }: ThreadsDisplayProps) => { className="w-full p-2 mb-2 rounded bg-gray-800 text-white" />