modified: internal/handlers/user.go
modified: internal/models/user.go modified: internal/repository/user_repository.go modified: internal/service/auth_service.go new file: internal/service/user_service.go modified: ../../begushiybashkir/bbvue/src/views/ProfileEdit.vue fix bag not editable profile
This commit is contained in:
@@ -24,6 +24,17 @@ type User struct {
|
||||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||||
}
|
||||
|
||||
type UserUpdate struct {
|
||||
ID uint `json:"id"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Phone string `json:"phone"`
|
||||
Experience string `json:"experience"`
|
||||
Goals string `json:"goals"`
|
||||
Newsletter bool `json:"newsletter"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// HashPassword хеширует пароль перед сохранением
|
||||
func (u *User) HashPassword() error {
|
||||
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(u.Password), bcrypt.DefaultCost)
|
||||
|
||||
Reference in New Issue
Block a user