fix: improve users.ts avatar object handling
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
36e2916dea
commit
365f84fae1
1 changed files with 5 additions and 4 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue