File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
const APIError = require ( "../api/APIError" ) ;
2
2
const FSNodeParam = require ( "../api/filesystem/FSNodeParam" ) ;
3
+ const { get_user } = require ( "../helpers" ) ;
3
4
const configurable_auth = require ( "../middleware/configurable_auth" ) ;
4
5
const { Endpoint } = require ( "../util/expressutil" ) ;
5
6
const BaseService = require ( "./BaseService" ) ;
@@ -98,6 +99,9 @@ class CommentService extends BaseService {
98
99
uid : comment . uid ,
99
100
text : comment . text ,
100
101
created : comment . created_at ,
102
+ user : {
103
+ username : comment . user ?. username ,
104
+ } ,
101
105
} ) ;
102
106
}
103
107
@@ -149,6 +153,12 @@ class CommentService extends BaseService {
149
153
[ await node . get ( 'mysql-id' ) ] ,
150
154
) ;
151
155
156
+ for ( const comment of comments ) {
157
+ const user_id = comment . user_id ;
158
+ const user = await get_user ( { id : user_id } ) ;
159
+ comment . user = user ;
160
+ }
161
+
152
162
return comments ;
153
163
}
154
164
}
You can’t perform that action at this time.
0 commit comments