diff --git a/internal/account/database.go b/internal/account/database.go index 29d0898..60211fe 100644 --- a/internal/account/database.go +++ b/internal/account/database.go @@ -14,7 +14,7 @@ func (db *Database) GetAllAccountOfUser(id string) ([]*Account, error) { FROM public.account a WHERE a.id = $1 ` - rows, err := db.Session.Query(q) + rows, err := db.Session.Query(q, id) if err != nil { return nil, err } diff --git a/internal/user/service.go b/internal/user/service.go index 1583cfc..73d5210 100644 --- a/internal/user/service.go +++ b/internal/user/service.go @@ -3,6 +3,7 @@ package user import ( "nos-comptes/internal/storage/dao" "nos-comptes/internal/storage/model" + "nos-comptes/internal/utils" ) type Service struct { @@ -16,6 +17,7 @@ func NewService(database *Database) *Service { func (s *Service) GetUserById(userId string) (*User, error) { user, err := s.db.GetUsersByID(userId) if e, ok := err.(*dao.Error); ok { + utils.GetLogger().Warn(err) switch { case e.Type == dao.ErrTypeNotFound: return nil, &model.ErrNotFound @@ -35,6 +37,7 @@ func (s *Service) GetUserById(userId string) (*User, error) { func (us *Service) GetUserFromGoogleID(googleUserID string) (*User, error) { user, err := us.db.GetUsersByGoogleID(googleUserID) if err != nil { + utils.GetLogger().Warn(err) if castedError, ok := err.(*dao.Error); ok { switch castedError.Type { case dao.ErrTypeNotFound: diff --git a/liquibase/changelogs/changelog-master.xml b/liquibase/changelogs/changelog-master.xml index cd69434..668241a 100644 --- a/liquibase/changelogs/changelog-master.xml +++ b/liquibase/changelogs/changelog-master.xml @@ -5,4 +5,7 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> + + +