Model layer is "complete"
I don't really like how it is for now but I will learn about it later
This commit is contained in:
+13
-2
@@ -4,6 +4,17 @@ import (
|
||||
mod "expenses/expenses/models"
|
||||
)
|
||||
|
||||
func GetAllUsers() ([]mod.User, error) {
|
||||
return mod.GetAllUsers()
|
||||
func (s *Service) GetAllUsers() ([]mod.User, error) {
|
||||
tx, err := s.DB.Begin()
|
||||
if err != nil {
|
||||
return []mod.User{}, err
|
||||
}
|
||||
defer tx.Rollback()
|
||||
|
||||
users, err := mod.GetAllUsers(tx)
|
||||
if err != nil {
|
||||
return []mod.User{}, err
|
||||
}
|
||||
|
||||
return users, tx.Commit()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user