Skip to content

Commit 7a43754

Browse files
authored
fix: return reply in async handlers (#295)
1 parent f8139ef commit 7a43754

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

examples/react-next-mini/renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function createRoute ({ handler, errorHandler, route }, scope, config) {
1515
if (route.getServerSideProps) {
1616
// If getServerSideProps is provided, register JSON endpoint for it
1717
scope.get(`/json${route.path}`, async (req, reply) => {
18-
reply.send(
18+
return reply.send(
1919
await route.getServerSideProps({
2020
req,
2121
fetchJSON: scope.fetchJSON,

examples/vue-next-mini/renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async function createRoute ({ handler, errorHandler, route }, scope, config) {
2323
if (route.getServerSideProps) {
2424
// If getServerSideProps is provided, register JSON endpoint for it
2525
scope.get(`/json${route.path}`, async (req, reply) => {
26-
reply.send(await route.getServerSideProps({
26+
return reply.send(await route.getServerSideProps({
2727
req,
2828
ky: scope.ky
2929
}))

packages/fastify-react/routing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export async function createRoute ({ client, errorHandler, route }, scope, confi
140140
scope.get(`/-/data${routePath}`, {
141141
onRequest,
142142
async handler (req, reply) {
143-
reply.send(await route.getData(req.route))
143+
return reply.send(await route.getData(req.route))
144144
},
145145
})
146146
}

packages/fastify-vue/routing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export async function createRoute ({ client, errorHandler, route }, scope, confi
142142
scope.get(`/-/data${routePath}`, {
143143
onRequest,
144144
async handler (req, reply) {
145-
reply.send(await route.getData(req.route))
145+
return reply.send(await route.getData(req.route))
146146
},
147147
})
148148
}

0 commit comments

Comments
 (0)