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-28 17:06:56 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6aa0a9eefa07bf906025162ea528763b08406eaf
6aa0a9ee
1 parent
727cf6ba
update outcomingMsg data type
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
front/src/Routes/Chat/ChatContainer.js
front/src/Routes/Chat/ChatContainer.js
View file @
6aa0a9e
...
...
@@ -14,7 +14,7 @@ export default withRouter(({ location }) => {
const
{
pathname
}
=
location
;
const
roomName
=
pathname
.
slice
(
1
,
pathname
.
length
);
let
messageObj
,
outcomingMsg
,
roomId
;
let
messageObj
,
outcomingMsg
,
outcomingTime
,
roomNum
;
if
(
roomName
!==
undefined
)
{
const
{
data
}
=
useQuery
(
GET_ROOM_BY_NAME
,
{
variables
:
{
roomName
}
});
...
...
@@ -23,7 +23,7 @@ export default withRouter(({ location }) => {
getRoomByName
:
{
id
:
roomId
},
},
}
=
data
;
console
.
log
(
roomId
);
roomNum
=
Number
(
roomId
);
}
const
[
createMsg
]
=
useMutation
(
WHOLE_MESSAGE
);
...
...
@@ -38,12 +38,12 @@ export default withRouter(({ location }) => {
messageObj
=
await
createMsg
({
variables
:
{
message
:
message
.
value
,
roomId
,
roomId
:
roomNum
,
},
});
const
{
text
}
=
messageObj
;
const
{
text
,
createdAt
}
=
messageObj
;
outcomingMsg
=
text
;
console
.
log
(
messageObj
)
;
outcomingTime
=
createdAt
;
}
catch
{
toast
.
error
(
"text must be not empty"
);
}
...
...
@@ -55,6 +55,7 @@ export default withRouter(({ location }) => {
message
=
{
message
}
onSubmit
=
{
onSubmit
}
outcomingMsg
=
{
outcomingMsg
}
outcomingTime
=
{
outcomingTime
}
/
>
);
});
...
...
Please
register
or
login
to post a comment