diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 465c9cb..df00a96 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -14,7 +14,7 @@ function App() { } /> } /> } /> - } /> + } /> diff --git a/frontend/src/constants/ApiConstants.js b/frontend/src/constants/ApiConstants.js index c7fd4b7..7cdec44 100644 --- a/frontend/src/constants/ApiConstants.js +++ b/frontend/src/constants/ApiConstants.js @@ -2,3 +2,4 @@ export const RADIOSTATION_URL = "http://localhost:8080/api"; export const CREATE_RADIOSTATION_ENDPOINT = "/radio-stations"; export const LIST_RADIOSTATIONS_ENDPOINT = "/radio-stations"; +export const ADD_CLIENT_ENDPOINT = "/clients/connect"; diff --git a/frontend/src/screens/JoinStation.jsx b/frontend/src/screens/JoinStation.jsx index ed2fff4..b1f4cc1 100644 --- a/frontend/src/screens/JoinStation.jsx +++ b/frontend/src/screens/JoinStation.jsx @@ -5,10 +5,13 @@ import { getStations } from "../utils/GetStations"; function JoinStation() { const navigate = useNavigate(); const [stations, setStations] = useState([]); + const [displayName, setDisplayName] = useState(""); const handleJoinStation = (stationID) => { - console.log("Joining station with ID:" + stationID); - navigate(`/station/${stationID}`); + // console.log("Joining station with ID:" + stationID); + if (!displayName) return; // USER HAS TO HAVE DISPLAY NAME + + navigate(`/station/${stationID}/${displayName}`); }; useEffect(() => { @@ -26,6 +29,7 @@ function JoinStation() {
+