feat(accounts): improve account creation
This commit is contained in:
@@ -3,7 +3,6 @@ package user
|
||||
import (
|
||||
"nos-comptes/internal/storage/dao"
|
||||
"nos-comptes/internal/storage/model"
|
||||
"nos-comptes/internal/utils"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
@@ -17,7 +16,6 @@ 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
|
||||
@@ -37,7 +35,6 @@ 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