File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,10 @@ export default class TickDataSource extends MongoDataSource<TickType> {
103103 throw new Error ( 'No such user' )
104104 }
105105 // Unfortunately, userIds on ticks are stored as strings not MUUIDs.
106- return await this . tickModel . find ( { userId : userIdObject . _id . toUUID ( ) . toString ( ) } )
106+ return await this . tickModel
107+ . find ( { userId : userIdObject . _id . toUUID ( ) . toString ( ) } )
108+ . sort ( { dateClimbed : - 1 } )
109+ . lean ( )
107110 }
108111
109112 /**
@@ -112,7 +115,10 @@ export default class TickDataSource extends MongoDataSource<TickType> {
112115 * @param climbId climb uuid
113116 */
114117 async ticksByUserIdAndClimb ( climbId : string , userId ?: string ) : Promise < TickType [ ] > {
115- return await this . tickModel . find ( { ...( userId != null && { userId } ) , climbId } ) . sort ( { dateClimbed : - 1 } ) . lean ( )
118+ return await this . tickModel
119+ . find ( { ...( userId != null && { userId } ) , climbId } )
120+ . sort ( { dateClimbed : - 1 } )
121+ . lean ( )
116122 }
117123
118124 static instance : TickDataSource
You can’t perform that action at this time.
0 commit comments