File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -205,10 +205,10 @@ export class ConversationsService {
205205 } ;
206206 }
207207
208- private async convertToConversationDetail (
208+ private convertToConversationDetail (
209209 conversation : Conversation ,
210210 messages : Message [ ] ,
211- ) : Promise < ConversationDetailDto > {
211+ ) : ConversationDetailDto {
212212 const detail : ConversationDetailDto = {
213213 id : conversation . id ,
214214 title : conversation . title ,
@@ -275,7 +275,7 @@ export class ConversationsService {
275275 user . id ,
276276 conversation . id ,
277277 ) ;
278- return await this . convertToConversationDetail ( conversation , messages ) ;
278+ return this . convertToConversationDetail ( conversation , messages ) ;
279279 }
280280
281281 async getConversationForShare (
@@ -289,7 +289,7 @@ export class ConversationsService {
289289 undefined ,
290290 conversation . id ,
291291 ) ;
292- return await this . convertToConversationDetail ( conversation , messages ) ;
292+ return this . convertToConversationDetail ( conversation , messages ) ;
293293 }
294294
295295 async findOne ( id : string ) {
Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ export class UserController {
6969 return await this . userService . createOption ( req . user . id , createOptionDto ) ;
7070 }
7171
72+ @Get ( 'option/list' )
73+ async listOption ( @Req ( ) req ) {
74+ return await this . userService . listOption ( req . user . id ) ;
75+ }
76+
7277 @Get ( 'option/:name' )
7378 async getOption ( @Req ( ) req , @Param ( 'name' ) name : string ) {
7479 return await this . userService . getOption ( req . user . id , name ) ;
Original file line number Diff line number Diff line change @@ -420,6 +420,16 @@ export class UserService {
420420 await repo . save ( repo . create ( { userId, name, value } ) ) ;
421421 }
422422
423+ async listOption ( userId : string , entityManager ?: EntityManager ) {
424+ const repo = entityManager
425+ ? entityManager . getRepository ( UserOption )
426+ : this . userOptionRepository ;
427+ const optionList = await repo . findBy ( {
428+ userId,
429+ } ) ;
430+ return optionList ;
431+ }
432+
423433 async getOption ( userId : string , name : string , entityManager ?: EntityManager ) {
424434 const repo = entityManager
425435 ? entityManager . getRepository ( UserOption )
You can’t perform that action at this time.
0 commit comments