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
4178bed0
Commit
4178bed0
authored
Aug 11, 2021
by
우지원
Browse files
방퇴장 수정
parent
5fb56d3d
Changes
2
Show whitespace changes
Inline
Side-by-side
server/controllers/room.controller.js
View file @
4178bed0
...
@@ -124,7 +124,9 @@ const exitRoom = async (req, res) => {
...
@@ -124,7 +124,9 @@ const exitRoom = async (req, res) => {
);
);
const
user
=
await
User
.
findOne
({
where
:
{
id
:
id
}
});
const
user
=
await
User
.
findOne
({
where
:
{
id
:
id
}
});
const
index2
=
user
.
roomNumber
.
indexOf
(
id
);
console
.
log
(
'
user
'
,
user
,
user
.
roomNumber
)
const
index2
=
user
.
roomNumber
.
indexOf
(
roomId
);
console
.
log
(
'
제발제발
'
,
index2
,
roomId
,
user
.
roomNumber
)
user
.
roomNumber
.
splice
(
index2
,
1
);
user
.
roomNumber
.
splice
(
index2
,
1
);
const
newUser
=
await
User
.
update
(
const
newUser
=
await
User
.
update
(
{
roomNumber
:
user
.
roomNumber
},
{
roomNumber
:
user
.
roomNumber
},
...
...
server/index.js
View file @
4178bed0
...
@@ -20,7 +20,7 @@ sequelize
...
@@ -20,7 +20,7 @@ sequelize
email
:
"
admin
"
,
email
:
"
admin
"
,
password
:
"
admin!
"
,
password
:
"
admin!
"
,
gender
:
0
,
gender
:
0
,
roomNumber
:
[
"
1234567abc
"
,
"
abc7654321
"
],
roomNumber
:
[],
});
});
// await Room.create({
// await Room.create({
...
...
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