Skip to content

Commit

Permalink
fix(repositories): correctly insert in db audit logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed Dec 19, 2024
1 parent 3729c64 commit 24ac0ab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 74 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

5 changes: 3 additions & 2 deletions libs/repositories/audit_logs/pgx/pgx.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ func (p *Pgx) GetMany(ctx context.Context, input audit_logs.GetManyInput) (
"user_id",
"created_at",
).
From("audit_logs")
From("audit_logs").
OrderBy("created_at DESC")

perPage := input.Limit
if perPage == 0 {
Expand Down Expand Up @@ -151,7 +152,7 @@ func (p *Pgx) Create(ctx context.Context, input audit_logs.CreateInput) (model.A
"user_id": input.UserID,
},
).
Prefix("RETURNING id")
Suffix("RETURNING id")

query, args, err := insertBuilder.ToSql()
if err != nil {
Expand Down

0 comments on commit 24ac0ab

Please sign in to comment.