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-06-01 02:13:52 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a27b80fc8ad77b346881fd32982cfa30a0973f36
a27b80fc
1 parent
f23be567
create seeAllMessage
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
back/src/api/Message/seeAllMessage/seeAllMessage.graphql
back/src/api/Message/seeAllMessage/seeAllMessage.js
back/src/api/Message/seeAllMessage/seeAllMessage.graphql
0 → 100644
View file @
a27b80f
type Query {
seeAllMessage(roomId: Int!): [Message]
}
back/src/api/Message/seeAllMessage/seeAllMessage.js
0 → 100644
View file @
a27b80f
import
{
prisma
}
from
"../../../utils"
;
export
default
{
Query
:
{
seeAllMessage
:
async
(
_
,
args
)
=>
{
const
{
roomId
}
=
args
;
let
room
,
messageList
;
try
{
room
=
await
prisma
.
room
.
findOne
({
where
:
{
id
:
roomId
,
},
});
if
(
room
!==
undefined
)
{
messageList
=
await
prisma
.
message
.
findMany
({
where
:
{
roomId
:
roomId
,
},
});
}
}
catch
(
e
)
{
console
.
log
(
e
);
}
return
messageList
;
},
},
};
Please
register
or
login
to post a comment