Skip to content

Commit 3b4a931

Browse files
committed
use typeMap to skip computational work in getIdFields() whenever possible
1 parent 42adde0 commit 3b4a931

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/server/src/api/rest/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,11 @@ class RequestHandler extends APIHandlerBase {
11781178
//#region utilities
11791179
private getIdFields(modelMeta: ModelMeta, model: string): FieldInfo[] {
11801180
const modelLower = lowerCaseFirst(model);
1181+
1182+
if (this.typeMap && modelLower in this.typeMap) {
1183+
return this.typeMap[modelLower].idFields;
1184+
}
1185+
11811186
if (!(modelLower in this.externalIdMapping)) {
11821187
return getIdFields(modelMeta, model);
11831188
}

0 commit comments

Comments
 (0)