mirror of
https://github.com/docmost/docmost.git
synced 2025-11-15 20:41:08 +10:00
feat: add Table of contents (#981)
* chore: add table of contents module * refactor * lint * null check --------- Co-authored-by: Philipinho <16838612+Philipinho@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { OmitType, PartialType } from '@nestjs/mapped-types';
|
||||
import { CreateUserDto } from '../../auth/dto/create-user.dto';
|
||||
import { IsBoolean, IsOptional, IsString } from 'class-validator';
|
||||
import { CreateUserDto } from '../../auth/dto/create-user.dto';
|
||||
|
||||
export class UpdateUserDto extends PartialType(
|
||||
OmitType(CreateUserDto, ['password'] as const),
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { UserRepo } from '@docmost/db/repos/user/user.repo';
|
||||
import {
|
||||
BadRequestException,
|
||||
Injectable,
|
||||
NotFoundException,
|
||||
} from '@nestjs/common';
|
||||
import { UpdateUserDto } from './dto/update-user.dto';
|
||||
import { UserRepo } from '@docmost/db/repos/user/user.repo';
|
||||
|
||||
@Injectable()
|
||||
export class UserService {
|
||||
@ -27,8 +27,9 @@ export class UserService {
|
||||
|
||||
// preference update
|
||||
if (typeof updateUserDto.fullPageWidth !== 'undefined') {
|
||||
return this.updateUserPageWidthPreference(
|
||||
return this.userRepo.updatePreference(
|
||||
userId,
|
||||
'fullPageWidth',
|
||||
updateUserDto.fullPageWidth,
|
||||
);
|
||||
}
|
||||
@ -55,12 +56,4 @@ 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