From 8686383f18c0d0fc80a0c99a8d2f02707faaf8a2 Mon Sep 17 00:00:00 2001 From: Chris Chan Date: Thu, 30 Nov 2023 14:56:18 -0500 Subject: [PATCH] Fix navigation bug --- web/meetup-facilitator/src/pages/Preferences.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/web/meetup-facilitator/src/pages/Preferences.jsx b/web/meetup-facilitator/src/pages/Preferences.jsx index 4379a13..ca1acf4 100644 --- a/web/meetup-facilitator/src/pages/Preferences.jsx +++ b/web/meetup-facilitator/src/pages/Preferences.jsx @@ -57,9 +57,7 @@ function Preferences() { const location = locationPrefs.current; const time = timePrefs.current.flat(); - console.log({time}) - - console.log({activities, location, time}); + if (activities.length === 0 || Object.keys(location).length === 0 || time.length === 0) alert("Please make sure at least one option is chosen for every preference.") @@ -86,13 +84,12 @@ function Preferences() { .then((response) => { if ("status" in response && response["status"] === 201) { alert("Preferences successfully saved. Redirecting to Recommendations.") - navigate(`/recommendations/${localStorage.getItem("email")}`); + navigate(`/recommendations/${group_id}`); } else alert("There was an issue saving preferences. Please try again."); }) } - navigate(`/recommendations/${group_id}/`); }