Skip to content

Commit

Permalink
fix(json-api-nestjs): fix primary field
Browse files Browse the repository at this point in the history
if name of primary field is not 'id', not include to response
  • Loading branch information
Alexander Kharkovey committed Dec 17, 2022
1 parent 5c34a23 commit b1ef3c0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ export class TransformMixinService<T> {
: [itemRow[field]];

for (const includeItem of includeArray) {
const { id } = includeItem;
const idName = this.relationPrimaryField.get(field)
const id = includeItem[idName];
if (result[field][id]) {
continue;
}
Expand Down

0 comments on commit b1ef3c0

Please sign in to comment.