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
ddf82690
Commit
ddf82690
authored
Jan 18, 2021
by
우지원
Browse files
e
parent
1e39e798
Changes
4
Hide whitespace changes
Inline
Side-by-side
client/src/Components/OpenList.js
View file @
ddf82690
...
@@ -3,7 +3,7 @@ import { ListGroup } from 'react-bootstrap';
...
@@ -3,7 +3,7 @@ import { ListGroup } from 'react-bootstrap';
import
axios
from
'
axios
'
import
axios
from
'
axios
'
function
OpenList
(
props
)
{
function
OpenList
(
props
)
{
const
[
list
,
set
L
ist
]
=
useState
([]);
const
[
open
list
,
set
Openl
ist
]
=
useState
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
getOpenList
();
getOpenList
();
...
@@ -12,7 +12,7 @@ function OpenList(props) {
...
@@ -12,7 +12,7 @@ function OpenList(props) {
async
function
getOpenList
()
{
async
function
getOpenList
()
{
let
res
=
await
axios
.
get
(
'
/room/openlist
'
)
let
res
=
await
axios
.
get
(
'
/room/openlist
'
)
console
.
log
(
'
가져온거
'
,
res
)
console
.
log
(
'
가져온거
'
,
res
)
set
L
ist
(
res
.
data
)
set
Openl
ist
(
res
.
data
)
}
}
...
@@ -29,10 +29,10 @@ function OpenList(props) {
...
@@ -29,10 +29,10 @@ function OpenList(props) {
return
(
return
(
<
div
>
<
div
>
{
list
.
map
((
item
,
index
)
=>
{
open
list
.
map
((
item
,
index
)
=>
<
ListGroup
key
=
{
index
}
>
<
ListGroup
key
=
{
index
}
>
<
ListGroup
.
Item
action
onClick
=
{
enterChatroomCH
}
name
=
{
list
.
roomName
}
>
<
ListGroup
.
Item
action
onClick
=
{
enterChatroomCH
}
name
=
{
item
.
roomName
}
>
{
list
.
roomName
}
{
item
.
roomName
}
<
/ListGroup.Item
>
<
/ListGroup.Item
>
<
/ListGroup
>
<
/ListGroup
>
)}
)}
...
...
client/src/Pages/HomePage.js
View file @
ddf82690
...
@@ -37,7 +37,6 @@ function Home() {
...
@@ -37,7 +37,6 @@ function Home() {
const
handleClose2
=
()
=>
setShow2
(
false
);
const
handleClose2
=
()
=>
setShow2
(
false
);
const
handleShow2
=
()
=>
setShow2
(
true
);
const
handleShow2
=
()
=>
setShow2
(
true
);
const
moderator
=
sessionStorage
.
getItem
(
'
userId
'
);
const
member
=
sessionStorage
.
getItem
(
'
userId
'
);
const
member
=
sessionStorage
.
getItem
(
'
userId
'
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -47,7 +46,7 @@ function Home() {
...
@@ -47,7 +46,7 @@ function Home() {
function
handleChange
(
event
)
{
function
handleChange
(
event
)
{
const
{
name
,
value
}
=
event
.
target
const
{
name
,
value
}
=
event
.
target
setRoom
({
...
room
,
[
name
]:
value
,
moderator
,
member
})
setRoom
({
...
room
,
[
name
]:
value
,
member
})
//console.log(room)
//console.log(room)
}
}
...
...
server/controllers/room.controller.js
View file @
ddf82690
...
@@ -6,8 +6,8 @@ const nanoid = customAlphabet('1234567890abcdef', 10)
...
@@ -6,8 +6,8 @@ const nanoid = customAlphabet('1234567890abcdef', 10)
const
makeRoom
=
async
(
req
,
res
)
=>
{
const
makeRoom
=
async
(
req
,
res
)
=>
{
console
.
log
(
req
.
body
)
console
.
log
(
req
.
body
)
const
{
roomName
,
interest
,
isOpen
,
moderator
,
member
}
=
req
.
body
;
const
{
roomName
,
interest
,
isOpen
,
member
}
=
req
.
body
;
console
.
log
(
roomName
,
interest
,
isOpen
,
moderator
,
member
)
console
.
log
(
roomName
,
interest
,
isOpen
,
member
)
const
roomId
=
nanoid
()
const
roomId
=
nanoid
()
const
room
=
await
Room
.
findOne
({
roomId
})
const
room
=
await
Room
.
findOne
({
roomId
})
...
@@ -27,7 +27,6 @@ const makeRoom = async (req, res) => {
...
@@ -27,7 +27,6 @@ const makeRoom = async (req, res) => {
roomName
,
roomName
,
interest
,
interest
,
isOpen
,
isOpen
,
moderator
,
member
,
member
,
}).
save
()
}).
save
()
console
.
log
(
newRoom
)
console
.
log
(
newRoom
)
...
...
server/models/Room.js
View file @
ddf82690
...
@@ -22,10 +22,6 @@ const RoomSchema = new mongoose.Schema({
...
@@ -22,10 +22,6 @@ const RoomSchema = new mongoose.Schema({
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
moderator
:
{
type
:
String
,
required
:
true
,
},
member
:
{
member
:
{
type
:
Array
,
type
:
Array
,
required
:
true
,
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