mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-03 12:47:44 +08:00
fix: list data undefined error (#3905)
* fix: list data undefined error * chore: typo
This commit is contained in:
parent
cc75f6f4d2
commit
c22fc6f5d4
@ -37,8 +37,19 @@ function createWithACLMetaMiddleware() {
|
||||
// @ts-ignore
|
||||
const primaryKeyField = Model.primaryKeyField || Model.primaryKeyAttribute;
|
||||
|
||||
const dataPath = ctx.body?.rows ? 'body.rows' : 'body';
|
||||
let listData = lodash.get(ctx, dataPath);
|
||||
let listData;
|
||||
|
||||
if (ctx.body?.data) {
|
||||
listData = ctx.data;
|
||||
} else if (ctx.body?.rows) {
|
||||
listData = ctx.body.rows;
|
||||
} else if (ctx.body) {
|
||||
listData = ctx.body;
|
||||
}
|
||||
|
||||
if (!listData) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (actionName == 'get') {
|
||||
listData = lodash.castArray(listData);
|
||||
|
Loading…
Reference in New Issue
Block a user