File tree Expand file tree Collapse file tree 3 files changed +1
-48
lines changed Expand file tree Collapse file tree 3 files changed +1
-48
lines changed Original file line number Diff line number Diff line change @@ -610,27 +610,6 @@ describe('GET Project', () => {
610
610
}
611
611
} ) ;
612
612
} ) ;
613
-
614
- it ( 'should not return "phases.products.name" field, when it\'s defined in "fields" query param but "phases" is not defined' , ( done ) => {
615
- request ( server )
616
-
617
- . get ( `/v5/projects/${ project1 . id } ?fields=id,phases.products.name` )
618
- . set ( {
619
- Authorization : `Bearer ${ testUtil . jwts . admin } ` ,
620
- } )
621
- . expect ( 'Content-Type' , / j s o n / )
622
- . expect ( 200 )
623
- . end ( ( err , res ) => {
624
- if ( err ) {
625
- done ( err ) ;
626
- } else {
627
- const resJson = res . body ;
628
- should . exist ( resJson ) ;
629
- resJson . should . not . have . property ( 'phases' ) ;
630
- done ( ) ;
631
- }
632
- } ) ;
633
- } ) ;
634
613
} ) ;
635
614
} ) ;
636
615
} ) ;
Original file line number Diff line number Diff line change @@ -1244,27 +1244,6 @@ describe('LIST Project', () => {
1244
1244
}
1245
1245
} ) ;
1246
1246
} ) ;
1247
-
1248
- it ( 'should not return "phases.products.name" field, when it\'s defined in "fields" query param but "phases" is not defined' , ( done ) => {
1249
- request ( server )
1250
- . get ( '/v5/projects/?fields=phases.products.name' )
1251
- . set ( {
1252
- Authorization : `Bearer ${ testUtil . jwts . admin } ` ,
1253
- } )
1254
- . expect ( 'Content-Type' , / j s o n / )
1255
- . expect ( 200 )
1256
- . end ( ( err , res ) => {
1257
- if ( err ) {
1258
- done ( err ) ;
1259
- } else {
1260
- const resJson = res . body ;
1261
- should . exist ( resJson ) ;
1262
- const project = _ . find ( resJson , p => p . id === 1 ) ;
1263
- project . should . not . have . property ( 'phases' ) ;
1264
- done ( ) ;
1265
- }
1266
- } ) ;
1267
- } ) ;
1268
1247
} ) ;
1269
1248
} ) ;
1270
1249
} ) ;
Original file line number Diff line number Diff line change @@ -256,12 +256,7 @@ _.assignIn(util, {
256
256
}
257
257
258
258
if ( allowedFields . project_phases_products ) {
259
- if ( fields . project_phases . length > 0 ) {
260
- parseSubFields ( 'project_phases_products' , 'phases.products' ) ;
261
- } else {
262
- // if donot have 'phases', so hide 'phases.products'
263
- fields . project_phases_products = [ ] ;
264
- }
259
+ parseSubFields ( 'project_phases_products' , 'phases.products' ) ;
265
260
}
266
261
}
267
262
return fields ;
You can’t perform that action at this time.
0 commit comments