From ce39b7ba3409f8e74a737d60c618e2ea74d88d7d Mon Sep 17 00:00:00 2001 From: Jean Jacques Avril Date: Mon, 10 Mar 2025 20:45:41 +0000 Subject: [PATCH] refactor: Update user model to use 'any' type for updates and adjust DTO path in configuration --- backend/internal/models/user.go | 4 ++-- backend/tygo.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/internal/models/user.go b/backend/internal/models/user.go index 06db8dc..630dbfd 100644 --- a/backend/internal/models/user.go +++ b/backend/internal/models/user.go @@ -454,7 +454,7 @@ func UpdateUser(ctx context.Context, update UserUpdate) (*User, error) { } // 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, "hash": pwData.Hash, }).Error; err != nil { @@ -463,7 +463,7 @@ func UpdateUser(ctx context.Context, update UserUpdate) (*User, error) { } // Create map for generic update - updates := make(map[string]interface{}) + updates := make(map[string]any) // Add only non-password fields to the update if update.Email != nil { diff --git a/backend/tygo.yml b/backend/tygo.yml index a382056..0781f4d 100644 --- a/backend/tygo.yml +++ b/backend/tygo.yml @@ -1,5 +1,5 @@ packages: - - path: github.com/timetracker/backend/internal/interfaces/http/dto + - path: github.com/timetracker/backend/dto type_mappings: "time.Time": "string" "ulid.ULID": "string"