Skip to content

Commit 210d760

Browse files
authored
Merge pull request #18 from klerick/fogate-check-if-notexist-ibject
fix(json-api-nestjs): forgot check if object not exist
2 parents 69d84a9 + 6822aa5 commit 210d760

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ export class TransformMixinService<T> {
145145
acum[key].push(plainObject);
146146
}
147147
} else {
148-
acum[key] = plainObject;
148+
acum[key] =
149+
plainObject[this.relationPrimaryField.get(key)] === null
150+
? undefined
151+
: plainObject;
149152
}
150153
return acum;
151154
}, dataJson[currentId]),

0 commit comments

Comments
 (0)