The common pattern for a user updating data is to allow for all data they can change to be passed into the handlers, but strip out any undefined keys they don't provide as to not accidentally override them. Right now there is a hacky transform before the zod parsing, however there is likely a cleaner way to do this (or just abstract to api-helpers package.) See updateComment and updateUserById for messy stripping.
The common pattern for a user updating data is to allow for all data they can change to be passed into the handlers, but strip out any undefined keys they don't provide as to not accidentally override them. Right now there is a hacky transform before the zod parsing, however there is likely a cleaner way to do this (or just abstract to api-helpers package.) See
updateComment
andupdateUserById
for messy stripping.