Refactor bio update logic in profile route: Adjust bio assignment to handle null values correctly, ensuring proper trimming and assignment of user bio data.
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled
This commit is contained in:
@@ -145,7 +145,7 @@ export async function PUT(request: Request) {
|
|||||||
updateData.avatar = avatar || null;
|
updateData.avatar = avatar || null;
|
||||||
}
|
}
|
||||||
if (bio !== undefined) {
|
if (bio !== undefined) {
|
||||||
updateData.bio = bio.trim() || null;
|
updateData.bio = bio === null ? null : bio.trim() || null;
|
||||||
}
|
}
|
||||||
if (characterClass !== undefined) {
|
if (characterClass !== undefined) {
|
||||||
updateData.characterClass = (characterClass as CharacterClass) || null;
|
updateData.characterClass = (characterClass as CharacterClass) || null;
|
||||||
|
|||||||
Reference in New Issue
Block a user