refactor: Update user model to use 'any' type for updates and adjust DTO path in configuration
This commit is contained in:
parent
d1720ea33d
commit
ce39b7ba34
@ -454,7 +454,7 @@ func UpdateUser(ctx context.Context, update UserUpdate) (*User, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update salt and hash directly in the model
|
// Update salt and hash directly in the model
|
||||||
if err := tx.Model(user).Updates(map[string]interface{}{
|
if err := tx.Model(user).Updates(map[string]any{
|
||||||
"salt": pwData.Salt,
|
"salt": pwData.Salt,
|
||||||
"hash": pwData.Hash,
|
"hash": pwData.Hash,
|
||||||
}).Error; err != nil {
|
}).Error; err != nil {
|
||||||
@ -463,7 +463,7 @@ func UpdateUser(ctx context.Context, update UserUpdate) (*User, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create map for generic update
|
// Create map for generic update
|
||||||
updates := make(map[string]interface{})
|
updates := make(map[string]any)
|
||||||
|
|
||||||
// Add only non-password fields to the update
|
// Add only non-password fields to the update
|
||||||
if update.Email != nil {
|
if update.Email != nil {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
packages:
|
packages:
|
||||||
- path: github.com/timetracker/backend/internal/interfaces/http/dto
|
- path: github.com/timetracker/backend/dto
|
||||||
type_mappings:
|
type_mappings:
|
||||||
"time.Time": "string"
|
"time.Time": "string"
|
||||||
"ulid.ULID": "string"
|
"ulid.ULID": "string"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user