mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-18 10:41:04 +10:00
add full page width preference
This commit is contained in:
@ -20,10 +20,19 @@ export class UserService {
|
||||
workspaceId: string,
|
||||
) {
|
||||
const user = await this.userRepo.findById(userId, workspaceId);
|
||||
|
||||
if (!user) {
|
||||
throw new NotFoundException('User not found');
|
||||
}
|
||||
|
||||
// preference update
|
||||
if (typeof updateUserDto.fullPageWidth !== 'undefined') {
|
||||
return this.updateUserPageWidthPreference(
|
||||
userId,
|
||||
updateUserDto.fullPageWidth,
|
||||
);
|
||||
}
|
||||
|
||||
if (updateUserDto.name) {
|
||||
user.name = updateUserDto.name;
|
||||
}
|
||||
@ -42,4 +51,12 @@ export class UserService {
|
||||
await this.userRepo.updateUser(updateUserDto, userId, workspaceId);
|
||||
return user;
|
||||
}
|
||||
|
||||
async updateUserPageWidthPreference(userId: string, fullPageWidth: boolean) {
|
||||
return this.userRepo.updatePreference(
|
||||
userId,
|
||||
'fullPageWidth',
|
||||
fullPageWidth,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user