moved to struct validation;
This commit is contained in:
@@ -23,7 +23,7 @@ type UserServiceInterface interface {
|
||||
GetUserByID(id uint) (*models.User, error)
|
||||
GetUsers(where map[string]interface{}) (*[]models.User, error)
|
||||
VerifyUser(token *string) (*models.User, error)
|
||||
UpdateUser(user *models.User, userRole int8) (*models.User, error)
|
||||
UpdateUser(user *models.User) (*models.User, error)
|
||||
}
|
||||
|
||||
type UserService struct {
|
||||
@@ -31,7 +31,11 @@ type UserService struct {
|
||||
Licences repositories.LicenceInterface
|
||||
}
|
||||
|
||||
func (service *UserService) UpdateUser(user *models.User, userRole int8) (*models.User, error) {
|
||||
func (service *UserService) UpdateUser(user *models.User) (*models.User, error) {
|
||||
|
||||
if user.ID == 0 {
|
||||
return nil, errors.ErrUserNotFound
|
||||
}
|
||||
|
||||
if user.Password != "" {
|
||||
setPassword(user.Password, user)
|
||||
|
||||
Reference in New Issue
Block a user