fix(backend,frontend) remake update profile

This commit is contained in:
2026-05-09 11:42:41 +03:00
parent fe331026aa
commit 92e440deb0
14 changed files with 508 additions and 91 deletions
+9
View File
@@ -0,0 +1,9 @@
package models
type UpdateUserInput struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Phone string `json:"phone"`
Department string `json:"department"`
Role string `json:"role"`
}
+6 -2
View File
@@ -4,7 +4,11 @@ import "gorm.io/gorm"
type User struct {
gorm.Model `json:"-"`
Username string `gorm:"unique;not null"`
Password string `gorm:"not null" json:"-"`
Username string `gorm:"unique;not null" binding:"required"`
Password string `gorm:"not null" json:"-" binding:"required,min=8"`
Role string `gorm:"default:'Рабочий'" json:"role"`
FirstName string `json:"first_name" binding:"required"`
LastName string `gorm:"index" json:"last_name" binding:"required"`
Phone string `gorm:"index" json:"phone"`
Department string `json:"department" binding:"required"`
}