We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 823b868 + b17dfc6 commit 69d84a9Copy full SHA for 69d84a9
libs/json-api-nestjs/src/lib/mixin/service/transform/transform.mixin.ts
@@ -235,9 +235,12 @@ export class TransformMixinService<T> {
235
},
236
};
237
}
238
-
+ const idNameField =
239
+ table === this.currentResourceName
240
+ ? this.currentPrimaryField
241
+ : this.relationPrimaryField.get(table);
242
return {
- id: data[this.currentPrimaryField].toString(),
243
+ id: data[idNameField].toString(),
244
type: urlTable,
245
attributes,
246
relationships,
0 commit comments