File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,11 +63,7 @@ module.exports = {
6363 try {
6464 const group_id = req . params . group_id ;
6565
66- const projection = {
67- name : true , path : true ,
68- admins : true
69- } ;
70- const group = await groupService . read ( { _id : group_id } , projection ) ;
66+ const group = await groupService . read ( { _id : group_id } ) ;
7167
7268 // Invalid group_id
7369 if ( group === null ) throw new NotFoundError ( `NotFound: 검색결과가 없습니다.` ) ;
Original file line number Diff line number Diff line change @@ -23,9 +23,17 @@ module.exports = {
2323 return await Group . find ( query , projection ) ;
2424 } ,
2525
26- read : async ( query , projection = { name : true , path : true } ) => {
26+ read : async ( query , projection = { } ) => {
2727 try {
28- return await Group . findOne ( query , projection ) ;
28+ return await Group
29+ . findOne ( query , projection )
30+ . populate ( [ {
31+ path : 'admins' ,
32+ select : [ 'rank' , 'name' ]
33+ } , {
34+ path : 'inspectors' ,
35+ select : [ 'rank' , 'name' ]
36+ } ] ) ;
2937 } catch ( err ) {
3038 throw new RuntimeError ( err . message ) ;
3139 }
You can’t perform that action at this time.
0 commit comments