Commit 4a61d0d9 authored by 우지원's avatar 우지원
Browse files

Merge remote-tracking branch 'origin/jaeyeoniiiiii' into woojiweon

parents 691577ee 0309cd62
......@@ -22,19 +22,7 @@ function App() {
<Route path="/profile/:id/update" component={InfoUpdatePage} />
<Route path="/profile/:id" component={ProfilePage} />
<Route path="/room/:roomId/:channelId" component={RoomPage} />
<Route path="/room/:roomId" component={InitRoomPage}>
{/* <Switch>
<Route path={"/room/:roomId/meeting"}>
<></>
</Route>
<Route path={"/room/:roomId/normal"}>
<></>
</Route>
<Route path={"/room/:roomId/notice"}>
<></>
</Route>
</Switch> */}
</Route>
<Route path="/room/:roomId" component={InitRoomPage} />
<Route path="/room/Invite" component={InvitePage} />
</Switch>
{/* </AuthProvider> */}
......
......@@ -6,7 +6,7 @@ import catchErrors from "../../context/catchError";
const id = localStorage.getItem("user");
const INIT_ROOM = {
roomid:"",
roomId:"",
name: "",
profileimg: "",
member: "",
......@@ -14,21 +14,20 @@ const INIT_ROOM = {
const RoomSingle = () => {
const [room, setRoom] = useState([INIT_ROOM]);
const [error, setError] = useState("");
// const channelId = 1;
const {roomId}=useParams();
const channelId = 'main';
const {roomId}=useParams(room.roomId);
async function getJoinRoom(Id) {
try {
const User = await userApi.getUser(Id);
const RoomNumArr = User.roomNumber;
const Room = await roomApi.getRoom(RoomNumArr);
const roomlist = [];
for (const prop in Room) {
let roomlist = [];
for (let prop in Room) {
roomlist.push({
roomId:Room[prop].id,
name: Room[prop].name,
profileimg: Room[prop].profileimg,
member: Room[prop].member,
member: Room[prop].member.length,
});
}
setRoom(roomlist);
......@@ -39,7 +38,7 @@ const RoomSingle = () => {
useEffect(() => {
getJoinRoom(id);
}, [id]);
console.log(room)
const { profileimg } = room;
return (
......@@ -47,7 +46,7 @@ const RoomSingle = () => {
{room &&
room.map((el) => (
<Link
to={`/room/${el.roomId}/1`}
to={`/room/${el.roomId}/${channelId}`}
className="text-decoration-none text-dark"
>
<div
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment