@@ -399,15 +399,15 @@ router.put('/:id', requireAuth, async (req, res): Promise<void> => {
399399 await tx . user . update ( {
400400 where : { id : parseInt ( id as string ) } ,
401401 data : {
402- ...( name && { name } ) , // FIXME@P 3
403- ...( normalizedEthereumAddress !== undefined ? { ethereumAddress : normalizedEthereumAddress } : { } ) ,
404- ...{ solanaAddress : solanaAddress ? String ( solanaAddress ) . trim ( ) : null } ,
405- ...{ bitcoinAddress : bitcoinAddress ? String ( bitcoinAddress ) . trim ( ) : null } ,
406- ...{ bitcoinCashAddress : bitcoinCashAddress ? String ( bitcoinCashAddress ) . trim ( ) : null } ,
407- ...{ polkadotAddress : polkadotAddress ? String ( polkadotAddress ) . trim ( ) : null } ,
408- ...{ cosmosAddress : cosmosAddress ? String ( cosmosAddress ) . trim ( ) : null } ,
409- ...{ stellarAddress : stellarAddress ? String ( stellarAddress ) . trim ( ) : null } ,
410- ...{ icpAddress : icpAddress ? String ( icpAddress ) . trim ( ) : null } ,
402+ ...( name !== undefined && ( name && { name } ) ) , // FIXME@P 3
403+ ...( normalizedEthereumAddress !== undefined && { ethereumAddress : normalizedEthereumAddress } ) ,
404+ ...( solanaAddress !== undefined && { solanaAddress : solanaAddress ? String ( solanaAddress ) . trim ( ) : null } ) ,
405+ ...( bitcoinCashAddress !== undefined && { bitcoinCashAddress : bitcoinAddress ? String ( bitcoinAddress ) . trim ( ) : null } ) ,
406+ ...( bitcoinCashAddress !== undefined && { bitcoinCashAddress : bitcoinCashAddress ? String ( bitcoinCashAddress ) . trim ( ) : null } ) ,
407+ ...( polkadotAddress !== undefined && { polkadotAddress : polkadotAddress ? String ( polkadotAddress ) . trim ( ) : null } ) ,
408+ ...( cosmosAddress !== undefined && { cosmosAddress : cosmosAddress ? String ( cosmosAddress ) . trim ( ) : null } ) ,
409+ ...( stellarAddress !== undefined && { stellarAddress : stellarAddress ? String ( stellarAddress ) . trim ( ) : null } ) ,
410+ ...( icpAddress !== undefined && { icpAddress : icpAddress ? String ( icpAddress ) . trim ( ) : null } ) ,
411411 // TODO@P 3: `undefined` vs `null`:
412412 ...( normalizedVotingPleaPreference !== undefined && normalizedVotingPleaPreference !== null && { votingPleaUnsubscribed : normalizedVotingPleaPreference } )
413413 } ,
0 commit comments