Skip to content

Commit b1ef3c0

Browse files
author
Alexander Kharkovey
committed
fix(json-api-nestjs): fix primary field
if name of primary field is not 'id', not include to response
1 parent 5c34a23 commit b1ef3c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libs/json-api-nestjs/src/lib/mixin/service/transform/transform.mixin.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ export class TransformMixinService<T> {
273273
: [itemRow[field]];
274274

275275
for (const includeItem of includeArray) {
276-
const { id } = includeItem;
276+
const idName = this.relationPrimaryField.get(field)
277+
const id = includeItem[idName];
277278
if (result[field][id]) {
278279
continue;
279280
}

0 commit comments

Comments
 (0)