File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
libs/json-api-nestjs/src/lib/mixin/service/transform Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,9 @@ export class TransformMixinService<T> {
141141 val
142142 ) ;
143143 if ( Array . isArray ( acum [ key ] ) ) {
144- acum [ key ] . push ( plainObject ) ;
144+ if ( plainObject [ this . relationPrimaryField . get ( key ) ] !== null ) {
145+ acum [ key ] . push ( plainObject ) ;
146+ }
145147 } else {
146148 acum [ key ] = plainObject ;
147149 }
@@ -181,7 +183,6 @@ export class TransformMixinService<T> {
181183 const propsData = data [ field ] ;
182184 const typeName = getEntityName ( this . relationTarget . get ( field ) ) ;
183185 if ( Array . isArray ( propsData ) ) {
184- console . log ( propsData , this . relationPrimaryField . get ( field ) ) ;
185186 builtData . data = propsData . map ( ( i ) => ( {
186187 type : camelToKebab ( typeName ) ,
187188 id : i [ this . relationPrimaryField . get ( field ) ] . toString ( ) ,
You can’t perform that action at this time.
0 commit comments