diff --git a/packages/core/actions/src/actions/get.ts b/packages/core/actions/src/actions/get.ts index f88a87d7b..3db4db6ce 100644 --- a/packages/core/actions/src/actions/get.ts +++ b/packages/core/actions/src/actions/get.ts @@ -15,7 +15,7 @@ export async function get(ctx: Context, next) { context: ctx, }); - ctx.body = instance || {}; + ctx.body = instance || null; await next(); } diff --git a/packages/core/server/src/middlewares/data-wrapping.ts b/packages/core/server/src/middlewares/data-wrapping.ts index 1b5db6c4a..8d956344e 100644 --- a/packages/core/server/src/middlewares/data-wrapping.ts +++ b/packages/core/server/src/middlewares/data-wrapping.ts @@ -47,6 +47,10 @@ export function dataWrapping() { data: ctx.body, }; } + } else if (ctx.action) { + ctx.body = { + data: ctx.body, + }; } }; }