Skip to content

Commit 63c7cd0

Browse files
committed
bug fix
1 parent 81d8014 commit 63c7cd0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

backend/src/routes/users.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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@P3
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@P3
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@P3: `undefined` vs `null`:
412412
...(normalizedVotingPleaPreference !== undefined && normalizedVotingPleaPreference !== null && { votingPleaUnsubscribed: normalizedVotingPleaPreference })
413413
},

0 commit comments

Comments
 (0)