fix: use collection.filterTargetKey instead of Model.primaryKeyField (#8853)

This commit is contained in:
chenos
2026-03-11 23:18:23 +08:00
committed by GitHub
parent 8716931b97
commit ece3cde511
@@ -52,9 +52,14 @@ function createWithACLMetaMiddleware() {
return;
}
// @ts-ignore
const primaryKeyField = Model.primaryKeyField || Model.primaryKeyAttribute;
const filterTargetKey = collection.filterTargetKey;
// ensure we only proceed when there is a single string key
if (!filterTargetKey || typeof filterTargetKey !== 'string') {
return;
}
const primaryKeyField = filterTargetKey;
let listData;
if (ctx.body?.data) {