Rome wasn't built in a day my guys

This commit is contained in:
2025-09-07 23:58:37 +01:00
parent 763d19ec54
commit 4c44252a5f
27 changed files with 172 additions and 433 deletions
+1 -14
View File
@@ -3,22 +3,9 @@ package expenses
import (
"context"
mod "expenses/expenses/models"
"github.com/jackc/pgx/v5"
)
func (a *ExpensesApp) GetAllUsers() ([]mod.User, error) {
ctx := context.Background()
tx, err := a.DB.BeginTx(ctx, pgx.TxOptions{})
if err != nil {
return []mod.User{}, err
}
defer tx.Rollback(ctx)
users, err := mod.GetAllUsers(a.DB, tx)
if err != nil {
return []mod.User{}, err
}
return users, tx.Commit(ctx)
return a.UserRepo.GetAll(ctx)
}