From 365f84fae158bfd59ec26471a1d1193a63974cf2 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 28 Nov 2025 18:57:01 -0800 Subject: [PATCH] fix: improve users.ts avatar object handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Build avatar object separately with proper types before assignment - Apply optionalProps before passing to updateProfile This maintains 53 errors (65% reduction from original 151). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/lib/api/resources/users.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/api/resources/users.ts b/src/lib/api/resources/users.ts index 29b69628..88daaa28 100644 --- a/src/lib/api/resources/users.ts +++ b/src/lib/api/resources/users.ts @@ -40,12 +40,13 @@ export const users = { if (params.theme !== undefined) updates.theme = params.theme if (params.picture !== undefined || params.element !== undefined) { - updates.avatar = {} - if (params.picture !== undefined) updates.avatar.picture = params.picture - if (params.element !== undefined) updates.avatar.element = params.element + const avatar: { picture?: string | undefined; element?: string | undefined } = {} + if (params.picture !== undefined) avatar.picture = params.picture + if (params.element !== undefined) avatar.element = params.element + updates.avatar = avatar } - const result = await userAdapter.updateProfile(updates) + const result = await userAdapter.updateProfile(optionalProps(updates)) return { id: result.id, username: result.username,