mirror of
https://github.com/hazemKrimi/crimson-vault.git
synced 2026-05-01 18:20:27 +00:00
chore: trailing slash and associate clients with user
This commit is contained in:
@@ -7,7 +7,8 @@ import (
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
ID uint32 `json:"id" gorm:"primaryKey"`
|
||||
ID string `json:"id" gorm:"primaryKey"`
|
||||
UserID string `json:"userId"`
|
||||
CreatedAt time.Time `json:"createAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt gorm.DeletedAt `json:"deletedAt" gorm:"index"`
|
||||
|
||||
@@ -22,6 +22,7 @@ type User struct {
|
||||
Email string `json:"email"`
|
||||
Username string `json:"username" gorm:"unique"`
|
||||
Password string `json:"-"`
|
||||
Clients []Client `json:"clients" gorm:"constraint:OnUpdate:CASCADE,onDelete:CASCADE"`
|
||||
}
|
||||
|
||||
type CreateUserRequestBody struct {
|
||||
@@ -42,10 +43,10 @@ type UpdateUserRequestBody struct {
|
||||
Country string `json:"country" validate:"omitempty,alpha"`
|
||||
Phone string `json:"phone" validate:"omitempty,e164"`
|
||||
Email string `json:"email" validate:"omitempty,email"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
type UpdateUserSecurityDetailsBody struct {
|
||||
Username string `json:"username"`
|
||||
type UpdateUserSecurityCredentialsBody struct {
|
||||
Password string `json:"password" validate:"password"`
|
||||
ConfirmPassword string `json:"confirmPassword" validate:"password,eqcsfield=Password"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user