Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-05-04 19:59:19 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
21b7d8daf492ce766b1d361f805ede80dd90420d
21b7d8da
1 parent
9b826210
update newMessage.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
back/src/api/Chat/newMessage/newMessage.js
back/src/api/Chat/newMessage/newMessage.js
View file @
21b7d8d
...
...
@@ -47,18 +47,19 @@ export default {
if
(
!
room
)
{
throw
new
Error
(
"There is no room"
);
}
const
toUser
=
await
prisma
.
user
.
findOne
({
where
:
{
id
:
receiverId
,
},
});
const
subMessage
=
await
prisma
.
message
.
create
({
data
:
{
text
:
message
,
to
:
{
connect
:
{
id
:
receiverId
,
},
connect
:
[{
id
:
toUser
.
id
}],
},
from
:
{
connect
:
{
id
:
user
.
id
,
},
connect
:
[{
id
:
user
.
id
}],
},
room
:
{
connect
:
{
...
...
@@ -67,7 +68,6 @@ export default {
},
},
});
console
.
log
(
subMessage
);
pubsub
.
publish
(
ONE_TO_ONE_MESSAGE
,
subMessage
);
return
subMessage
;
},
...
...
Please
register
or
login
to post a comment