chore: migrate to gitea
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"budget/internal/storage/dao"
|
||||
"budget/internal/storage/model"
|
||||
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/storage/dao"
|
||||
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/storage/model"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
@@ -16,8 +16,8 @@ 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 {
|
||||
switch {
|
||||
case e.Type == dao.ErrTypeNotFound:
|
||||
switch e.Type {
|
||||
case dao.ErrTypeNotFound:
|
||||
return nil, &model.ErrNotFound
|
||||
default:
|
||||
return nil, &model.ErrInternalServer
|
||||
|
||||
Reference in New Issue
Block a user