Skip to content

Commit

Permalink
Return events in reversed order by default (#126)
Browse files Browse the repository at this point in the history
It is better to retrurn last events by default
  • Loading branch information
nt0xa authored Mar 21, 2023
1 parent ed707ea commit 39b12e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (c *Command) Exec(ctx context.Context, args []string) {

profile, err := c.actions.ProfileGet(ctx)
if err != nil {
c.handler.OnResult(ctx, actions.ErrorResult{errors.Unauthorized()})
c.handler.OnResult(ctx, actions.ErrorResult{err})
return
}

Expand Down
4 changes: 2 additions & 2 deletions internal/database/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func (db *DB) EventsListByPayloadID(payloadID int64, opts ...EventsListOption) (
var order string

if options.Reverse {
order = "DESC"
} else {
order = "ASC"
} else {
order = "DESC"
}

query, params = paginate(
Expand Down

0 comments on commit 39b12e4

Please sign in to comment.