mirror of
https://github.com/docmost/docmost.git
synced 2025-11-19 06:31:04 +10:00
feat: save language to locale column
This commit is contained in:
@ -15,5 +15,5 @@ export class UpdateUserDto extends PartialType(
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
language: string;
|
||||
locale: string;
|
||||
}
|
||||
|
||||
@ -33,13 +33,6 @@ export class UserService {
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof updateUserDto.language !== 'undefined') {
|
||||
return this.updateUserLanguagePreference(
|
||||
userId,
|
||||
updateUserDto.language,
|
||||
);
|
||||
}
|
||||
|
||||
if (updateUserDto.name) {
|
||||
user.name = updateUserDto.name;
|
||||
}
|
||||
@ -55,6 +48,10 @@ export class UserService {
|
||||
user.avatarUrl = updateUserDto.avatarUrl;
|
||||
}
|
||||
|
||||
if (updateUserDto.locale) {
|
||||
user.locale = updateUserDto.locale;
|
||||
}
|
||||
|
||||
await this.userRepo.updateUser(updateUserDto, userId, workspaceId);
|
||||
return user;
|
||||
}
|
||||
@ -66,8 +63,4 @@ export class UserService {
|
||||
fullPageWidth,
|
||||
);
|
||||
}
|
||||
|
||||
async updateUserLanguagePreference(userId: string, language: string) {
|
||||
return this.userRepo.updatePreference(userId, 'language', language);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user