diff --git a/internal/processor/user_processor.go b/internal/processor/user_processor.go index efe688f..d4d1bbc 100644 --- a/internal/processor/user_processor.go +++ b/internal/processor/user_processor.go @@ -118,12 +118,24 @@ func (p *UserProcessorImpl) UpdateUser(ctx context.Context, id uuid.UUID, req *c } updated := transformer.UpdateUserEntity(existingUser, req) + fmt.Printf("Test Updated: %+v\n", updated) err = p.userRepo.Update(ctx, updated) if err != nil { return nil, fmt.Errorf("failed to update user: %w", err) } + if(req.Name != nil) { + profile, err := p.profileRepo.GetByUserID(ctx, updated.ID) + if err != nil { + return nil, fmt.Errorf("failed to get user profile: %w", err) + } + profile.FullName = *req.Name + if err := p.profileRepo.Update(ctx, profile); err != nil { + return nil, fmt.Errorf("failed to update user profile: %w", err) + } + } + // Update departments if provided if req.DepartmentIDs != nil { departments := make([]entities.Department, len(*req.DepartmentIDs))