From 780b646d68e3a25ec567be95f5b6afb4fb6ea49a Mon Sep 17 00:00:00 2001 From: Ethan Wellenreiter Date: Wed, 7 May 2025 10:24:53 -0400 Subject: [PATCH] Minor fixes and formatting delete should be called on the existing transaction for users. Added an empty line in roles Signed-off-by: Ethan Wellenreiter --- backend/internal/storage/sql-roles.go | 1 + backend/internal/storage/sql-users.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/internal/storage/sql-roles.go b/backend/internal/storage/sql-roles.go index 84c9d60..1109386 100644 --- a/backend/internal/storage/sql-roles.go +++ b/backend/internal/storage/sql-roles.go @@ -23,6 +23,7 @@ func (s *SQLRolesStore) GetByName(ctx context.Context, name string) (*Role, erro return role, nil } + func (s *SQLRolesStore) GetById(ctx context.Context, id int64) (*Role, error) { ctx, cancel := context.WithTimeout(ctx, QueryTimeoutDuration) defer cancel() diff --git a/backend/internal/storage/sql-users.go b/backend/internal/storage/sql-users.go index 1d6facf..77cd0a2 100644 --- a/backend/internal/storage/sql-users.go +++ b/backend/internal/storage/sql-users.go @@ -195,7 +195,7 @@ func (s *SQLUsersStore) delete(ctx context.Context, id int64, tx *sql.Tx) error ctx, cancel := context.WithTimeout(ctx, QueryTimeoutDuration) defer cancel() - res, err := s.db.ExecContext(ctx, query, id) + res, err := tx.ExecContext(ctx, query, id) if err != nil { return err }