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
messenger
Commits
31ac640d
Commit
31ac640d
authored
Jan 18, 2021
by
Choi Ga Young
Browse files
이름변경
parent
1e39e798
Changes
4
Hide whitespace changes
Inline
Side-by-side
client/src/Components/OpenList.js
View file @
31ac640d
...
...
@@ -3,7 +3,7 @@ import { ListGroup } from 'react-bootstrap';
import
axios
from
'
axios
'
function
OpenList
(
props
)
{
const
[
list
,
set
L
ist
]
=
useState
([]);
const
[
open
list
,
set
Openl
ist
]
=
useState
([]);
useEffect
(()
=>
{
getOpenList
();
...
...
@@ -11,8 +11,8 @@ function OpenList(props) {
async
function
getOpenList
()
{
let
res
=
await
axios
.
get
(
'
/room/openlist
'
)
console
.
log
(
'
가져온거
'
,
res
)
set
L
ist
(
res
.
data
)
console
.
log
(
'
가져온거
o
'
,
res
)
set
Openl
ist
(
res
.
data
)
}
...
...
@@ -25,14 +25,12 @@ function OpenList(props) {
// props.clearChat()
}
//user.hasOwnProperty('이름');
return
(
<
div
>
{
list
.
map
((
item
,
index
)
=>
{
open
list
.
map
((
item
,
index
)
=>
<
ListGroup
key
=
{
index
}
>
<
ListGroup
.
Item
action
onClick
=
{
enterChatroomCH
}
name
=
{
list
.
roomName
}
>
{
list
.
roomName
}
<
ListGroup
.
Item
action
onClick
=
{
enterChatroomCH
}
name
=
{
item
.
roomName
}
>
{
item
.
roomName
}
<
/ListGroup.Item
>
<
/ListGroup
>
)}
...
...
client/src/Pages/HomePage.js
View file @
31ac640d
...
...
@@ -62,8 +62,6 @@ function Home() {
console
.
log
(
res
.
data
.
roomId
)
const
Id
=
res
.
data
.
roomId
alert
(
`방암호는
${
Id
}
입니다`
)
// setSuccess(true)
// setRoom(INIT_ROOM)
setShow
(
false
)
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
...
...
server/controllers/room.controller.js
View file @
31ac640d
...
...
@@ -6,8 +6,8 @@ const nanoid = customAlphabet('1234567890abcdef', 10)
const
makeRoom
=
async
(
req
,
res
)
=>
{
console
.
log
(
req
.
body
)
const
{
roomName
,
interest
,
isOpen
,
moderator
,
member
}
=
req
.
body
;
console
.
log
(
roomName
,
interest
,
isOpen
,
moderator
,
member
)
const
{
roomName
,
interest
,
isOpen
,
member
}
=
req
.
body
;
console
.
log
(
roomName
,
interest
,
isOpen
,
member
)
const
roomId
=
nanoid
()
const
room
=
await
Room
.
findOne
({
roomId
})
...
...
@@ -27,7 +27,6 @@ const makeRoom = async (req, res) => {
roomName
,
interest
,
isOpen
,
moderator
,
member
,
}).
save
()
console
.
log
(
newRoom
)
...
...
@@ -49,7 +48,6 @@ const getClosedList = async (req, res) => {
}
}
const
getOpenList
=
async
(
req
,
res
)
=>
{
try
{
let
list
=
await
Room
.
find
({
isOpen
:
true
})
...
...
server/models/Room.js
View file @
31ac640d
...
...
@@ -22,10 +22,6 @@ const RoomSchema = new mongoose.Schema({
type
:
Boolean
,
required
:
true
,
},
moderator
:
{
type
:
String
,
required
:
true
,
},
member
:
{
type
:
Array
,
required
:
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