Created edit for users

This commit is contained in:
tdv
2025-12-04 16:07:51 +02:00
parent 50850897c0
commit 1284c1c4c1
5 changed files with 178 additions and 16 deletions

View File

@@ -20,6 +20,12 @@ type CreateUserDto struct {
Role string `json:"role" binding:"required,oneof=admin user"`
}
type UpdateUserDto struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Role string `json:"role,omitempty" binding:"oneof=admin user"`
}
func MapUser(u models.User) UserDto {
return UserDto{
ID: u.ID,