Skip to content

Commit 27e2d91

Browse files
author
Alexander Kharkovey
committed
feat(json-api-nestjs): fix incorrect type in include
1 parent ee6d037 commit 27e2d91

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,11 @@ export class TransformMixinService<T> {
278278
(acum, item) => {
279279
const items = Object.values<T>(result[item]);
280280
acum.push(
281-
...(items.map((i) => this.transformData(i, [], item)) as any)
281+
...(items.map((i) => {
282+
const dataForInclude = this.transformData(i, [], item);
283+
dataForInclude.type = camelToKebab(i['constructor']['name']);
284+
return dataForInclude;
285+
}) as any)
282286
);
283287
return acum;
284288
},

0 commit comments

Comments
 (0)