Merge branch 'develop' into feat-1714

This commit is contained in:
かっこかり 2024-07-07 22:45:55 +09:00 committed by GitHub
commit d913a1bb9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 558 additions and 17 deletions

View file

@ -257,7 +257,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
if (ps.name !== undefined) updates.name = ps.name;
if (ps.name !== undefined) {
if (ps.name === null) {
updates.name = null;
} else {
const trimmedName = ps.name.trim();
updates.name = trimmedName === '' ? null : trimmedName;
}
}
if (ps.description !== undefined) profileUpdates.description = ps.description;
if (ps.lang !== undefined) profileUpdates.lang = ps.lang;
if (ps.location !== undefined) profileUpdates.location = ps.location;