Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
bora-it
Commits
0e228dad
Commit
0e228dad
authored
Aug 07, 2021
by
우지원
Browse files
채널퇴장 오류해결
parent
5eb8bad9
Changes
3
Show whitespace changes
Inline
Side-by-side
client/src/components/Room/ChannelSingle.js
View file @
0e228dad
...
...
@@ -24,7 +24,7 @@ const ChannelSingle = (props) => {
if
(
A
)
{
await
roomApi
.
doubleJoin
({
roomId
:
roomId
,
index1
:
A
.
index1
,
index2
:
A
.
index2
,
joinChName
:
A
.
joinChName
})
}
const
roomA
=
await
roomApi
.
joinChannel
({
roomId
:
roomId
,
channelName
:
e
,
plusUser
:
data
.
name
,
index
:
index1
})
await
roomApi
.
joinChannel
({
roomId
:
roomId
,
channelName
:
e
,
plusUser
:
data
.
name
,
index
:
index1
})
setRoomName
(
e
)
setSuccess
(
true
)
}
else
{
...
...
@@ -69,7 +69,6 @@ const ChannelSingle = (props) => {
<
div
className
=
"
overflow-auto
"
style
=
{{
height
:
'
610px
'
}}
>
{
props
.
channel
.
map
((
el
,
i
)
=>
(
<
div
className
=
"
mb-3
"
key
=
{
`channel
${
i
}
`
}
>
<
Link
to
=
{
`/room/
${
roomId
}
/
${
el
.
channelName
}
`
}
>
<
div
className
=
"
m-3 p-1 row
"
style
=
{{
backgroundColor
:
'
#E0CEE8
'
}}
...
...
@@ -94,10 +93,9 @@ const ChannelSingle = (props) => {
{
el
.
channelName
}
<
/h5
>
<
/div
>
<
/Link
>
{
el
.
join
Name
&&
el
.
join
Name
.
map
((
e
,
i
)
=>
(
{
el
.
join
User
&&
el
.
join
User
.
map
((
e
,
i
)
=>
(
<
div
key
=
{
`member
${
i
}
`
}
>
<
ul
className
=
"
mx-5
"
style
=
{{
color
:
'
#76D079
'
}}
>
<
li
>
...
...
client/src/components/Room/Roomnamechange.js
View file @
0e228dad
...
...
@@ -17,7 +17,7 @@ const Roomnamechange = () => {
async
function
getdata
(
Roomdata
)
{
try
{
const
data
=
await
RoomApi
.
getRoom
(
Roomdata
);
const
data
=
await
RoomApi
.
getRoom
(
[
Roomdata
]
);
setRoom
(
data
);
console
.
log
(
data
);
}
catch
(
error
)
{
...
...
server/controllers/room.controller.js
View file @
0e228dad
...
...
@@ -140,24 +140,16 @@ const changename = async (req, res) => {
const
joinChannel
=
async
(
req
,
res
)
=>
{
const
{
roomId
,
channelName
,
plusUser
,
index
}
=
req
.
body
;
console
.
log
(
"
연결성공
"
);
const
room
=
await
Room
.
findOne
({
where
:
{
id
:
roomId
}
});
room
.
channel
[
index
][
channelName
].
push
(
plusUser
);
console
.
log
(
"
확인2
"
,
room
.
channel
[
index
]);
console
.
log
(
"
확인2
"
,
room
.
channel
);
await
Room
.
update
({
channel
:
room
.
channel
},
{
where
:
{
id
:
roomId
}
});
return
res
.
json
(
true
);
};
const
doubleJoin
=
async
(
req
,
res
)
=>
{
console
.
log
(
"
연결성공
"
,
req
.
body
);
const
{
roomId
,
index1
,
index2
,
joinChName
}
=
req
.
body
;
console
.
log
(
index1
);
const
room
=
await
Room
.
findOne
({
where
:
{
id
:
roomId
}
});
console
.
log
(
room
.
channel
[
index1
][
joinChName
]);
room
.
channel
[
index1
][
joinChName
].
splice
(
index2
,
1
);
console
.
log
(
room
.
channel
[
index1
][
joinChName
]);
console
.
log
(
"
room.channel
"
,
room
.
channel
);
await
Room
.
update
({
channel
:
room
.
channel
},
{
where
:
{
id
:
roomId
}
});
return
res
.
json
(
true
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment