feat: page history

This commit is contained in:
Philipinho
2023-11-22 20:42:34 +00:00
parent 21347e6c42
commit 3f9b6e1380
50 changed files with 995 additions and 200 deletions
+17 -1
View File
@@ -17,6 +17,9 @@ import { MovePageDto } from './dto/move-page.dto';
import { PageDetailsDto } from './dto/page-details.dto';
import { DeletePageDto } from './dto/delete-page.dto';
import { PageOrderingService } from './services/page-ordering.service';
import { PageHistoryService } from './services/page-history.service';
import { HistoryDetailsDto } from './dto/history-details.dto';
import { PageHistoryDto } from './dto/page-history.dto';
@UseGuards(JwtGuard)
@Controller('pages')
@@ -24,13 +27,14 @@ export class PageController {
constructor(
private readonly pageService: PageService,
private readonly pageOrderService: PageOrderingService,
private readonly pageHistoryService: PageHistoryService,
private readonly workspaceService: WorkspaceService,
) {}
@HttpCode(HttpStatus.OK)
@Post('/details')
async getPage(@Body() input: PageDetailsDto) {
return this.pageService.findWithoutYDoc(input.id);
return this.pageService.findOne(input.id);
}
@HttpCode(HttpStatus.CREATED)
@@ -118,4 +122,16 @@ export class PageController {
return this.pageOrderService.convertToTree(workspaceId);
}
@HttpCode(HttpStatus.OK)
@Post('/history')
async getPageHistory(@Body() dto: PageHistoryDto) {
return this.pageHistoryService.findHistoryByPageId(dto.pageId);
}
@HttpCode(HttpStatus.OK)
@Post('/history/details')
async get(@Body() dto: HistoryDetailsDto) {
return this.pageHistoryService.findOne(dto.id);
}
}