feat(db): add missing changelog import
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user