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

This commit is contained in:
Julien Froidefond
2025-12-12 08:11:51 +01:00
parent db2993c50b
commit 6f98013382

View File

@@ -145,7 +145,7 @@ export async function PUT(request: Request) {
updateData.avatar = avatar || null;
}
if (bio !== undefined) {
updateData.bio = bio.trim() || null;
updateData.bio = bio === null ? null : bio.trim() || null;
}
if (characterClass !== undefined) {
updateData.characterClass = (characterClass as CharacterClass) || null;