fix: linting
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m19s
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m19s
This commit is contained in:
@@ -35,7 +35,7 @@ func (s ServiceImpl) Add(ctx context.Context, user *auth_types.User, budget Budg
|
|||||||
return nil, core.ErrUnauthorized
|
return nil, core.ErrUnauthorized
|
||||||
}
|
}
|
||||||
|
|
||||||
isValid := s.isBudgetValid(ctx, budget)
|
isValid := s.isBudgetValid(budget)
|
||||||
if !isValid {
|
if !isValid {
|
||||||
return nil, core.ErrBadRequest
|
return nil, core.ErrBadRequest
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ func (s ServiceImpl) Update(ctx context.Context, user *auth_types.User, budget B
|
|||||||
return nil, core.ErrBadRequest
|
return nil, core.ErrBadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
isValid := s.isBudgetValid(ctx, budget)
|
isValid := s.isBudgetValid(budget)
|
||||||
if !isValid {
|
if !isValid {
|
||||||
return nil, core.ErrBadRequest
|
return nil, core.ErrBadRequest
|
||||||
}
|
}
|
||||||
@@ -97,14 +97,14 @@ func (s ServiceImpl) GetAll(ctx context.Context, user *auth_types.User) ([]Budge
|
|||||||
return s.db.GetAll(ctx, user.Id)
|
return s.db.GetAll(ctx, user.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ServiceImpl) isBudgetValid(ctx context.Context, budget Budget) bool {
|
func (s ServiceImpl) isBudgetValid(budget Budget) bool {
|
||||||
if budget.Description != "" {
|
if budget.Description != "" {
|
||||||
err := core.ValidateString(budget.Description, "description")
|
err := core.ValidateString(budget.Description, "description")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
} else if budget.Value < 0 {
|
} else if budget.Value < 0 {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user