Skip to content

Commit 8e8b6a4

Browse files
committed
Fix API 8 test issue
Signed-off-by: Mlađan Mihajlović <[email protected]>
1 parent abfea1e commit 8e8b6a4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/openapi-to-graphql/test/example_api8_server.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,20 @@ function startServer(PORT) {
5959
})
6060

6161
app.post('/api/type', (req, res) => {
62-
if (req.body?.type?.name && !Types[req.body.type.name]) {
62+
if (
63+
req.body &&
64+
req.body.type &&
65+
req.body.type.name &&
66+
!Types[req.body.type.name]
67+
) {
6368
Types[req.body.type.name] = req.body.type
6469
}
6570

66-
res.send({ data: req.body.baseTypeCommandAttribute ?? 'created' })
71+
res.send({
72+
data: req.body.baseTypeCommandAttribute
73+
? req.body.baseTypeCommandAttribute
74+
: 'created'
75+
})
6776
})
6877

6978
return new Promise((resolve) => {

0 commit comments

Comments
 (0)