Skip to content

Commit

Permalink
fix: timeline ordering (#9898)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Krick <[email protected]>
  • Loading branch information
mattkrick authored Jun 27, 2024
1 parent 1b0fcef commit 9f5f38c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/server/graphql/types/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,13 @@ const User: GraphQLObjectType<any, GQLContext> = new GraphQLObjectType<any, GQLC
.selectFrom('TimelineEvent')
.selectAll()
.where('userId', '=', viewerId)
.where('createdAt', '>', minVal)
.where('createdAt', '<=', dbAfter)
.where((eb) => eb.between('createdAt', minVal, dbAfter))
.where('isActive', '=', true)
.where('teamId', 'in', validTeamIds)
.$if(!!eventTypes, (db) => db.where('type', 'in', eventTypes))
.orderBy('createdAt')
.orderBy('createdAt', 'desc')
.limit(first + 1)
.execute()

const edges = events.slice(0, first).map((node) => ({
cursor: node.createdAt,
node
Expand Down

0 comments on commit 9f5f38c

Please sign in to comment.