fix(server): fix messages in data-wrapping (#3485)

This commit is contained in:
Junyi 2024-02-03 10:37:28 +08:00 committed by GitHub
parent 33edd78531
commit 237c4aa084
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,9 +31,7 @@ export function dataWrapping() {
ctx.body = { ctx.body = {
data: ctx.body, data: ctx.body,
}; };
return; } else {
}
if (ctx.body) { if (ctx.body) {
const { rows, ...meta } = ctx.body; const { rows, ...meta } = ctx.body;
@ -56,6 +54,7 @@ export function dataWrapping() {
data: ctx.body, data: ctx.body,
}; };
} }
}
if (ctx.body && ctx.state.messages?.length) { if (ctx.body && ctx.state.messages?.length) {
ctx.body.messages = ctx.state.messages; ctx.body.messages = ctx.state.messages;