mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-04 13:48:56 +02:00
feat: now also sorting by id if in same transaction/date (#10290)
Also sort events by id, so they will be in correct order if done inside transaction.
This commit is contained in:
parent
30fbc62f9b
commit
778fb2ee17
@ -381,7 +381,10 @@ export class EventStore implements IEventStore {
|
||||
): Promise<IEvent[]> {
|
||||
const query = this.buildSearchQuery(queryParams, params.query)
|
||||
.select(options?.withIp ? [...EVENT_COLUMNS, 'ip'] : EVENT_COLUMNS)
|
||||
.orderBy('created_at', params.order || 'desc')
|
||||
.orderBy([
|
||||
{ column: 'created_at', order: params.order || 'desc' },
|
||||
{ column: 'id', order: params.order || 'desc' },
|
||||
])
|
||||
.limit(Number(params.limit) ?? 100)
|
||||
.offset(Number(params.offset) ?? 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user