Skip to content

Commit

Permalink
Fix API 8 test issue
Browse files Browse the repository at this point in the history
Signed-off-by: Mlađan Mihajlović <[email protected]>
  • Loading branch information
mladjanm committed Mar 29, 2021
1 parent abfea1e commit 8e8b6a4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/openapi-to-graphql/test/example_api8_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,20 @@ function startServer(PORT) {
})

app.post('/api/type', (req, res) => {
if (req.body?.type?.name && !Types[req.body.type.name]) {
if (
req.body &&
req.body.type &&
req.body.type.name &&
!Types[req.body.type.name]
) {
Types[req.body.type.name] = req.body.type
}

res.send({ data: req.body.baseTypeCommandAttribute ?? 'created' })
res.send({
data: req.body.baseTypeCommandAttribute
? req.body.baseTypeCommandAttribute
: 'created'
})
})

return new Promise((resolve) => {
Expand Down

0 comments on commit 8e8b6a4

Please sign in to comment.