File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export class UserActionDto {
2323 endDate : Date ;
2424 votersParticipated : number ;
2525 authorUserId : number ;
26+ createdAt : Date ;
2627}
2728
2829export class UserActivitiesResponseDto {
Original file line number Diff line number Diff line change @@ -77,16 +77,17 @@ export class UserService {
7777 } else if ( dto . filter === 'inactive' ) {
7878 filters . poll = { endDate : { lt : now } } ;
7979 } else if ( dto . filter === 'created' ) {
80- filters . type = ' CREATED' ;
80+ filters . type = ActionType . CREATED ;
8181 } else if ( dto . filter === 'participated' ) {
82- filters . type = ' VOTED' ;
82+ filters . type = ActionType . VOTED ;
8383 }
8484 const userActions = await this . databaseService . userAction . findMany ( {
8585 where : filters ,
86- orderBy : { poll : { endDate : 'desc' } } ,
86+ orderBy : { createdAt : 'desc' } ,
8787 select : {
8888 id : true ,
8989 type : true ,
90+ createdAt : true ,
9091 poll : {
9192 select : {
9293 pollId : true ,
@@ -109,6 +110,7 @@ export class UserService {
109110 isActive : action . poll . endDate >= now ,
110111 votersParticipated : action . poll . participantCount ,
111112 authorUserId : action . poll . authorUserId ,
113+ createdAt : action . createdAt ,
112114 } ) ) ;
113115 return { userActions : actions } ;
114116 }
You can’t perform that action at this time.
0 commit comments