mirror of
https://github.com/docmost/docmost.git
synced 2025-11-15 07:31:16 +10:00
Add new page module and services; refactor existing entities
- Introduced a new page module with associated services. - Refactored TypeORM entities in user and workspace modules.
This commit is contained in:
23
server/src/core/page/page.controller.ts
Normal file
23
server/src/core/page/page.controller.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { Controller, Post, Body, Delete, Get, Param } from "@nestjs/common";
|
||||
import { PageService } from './page.service';
|
||||
import { CreatePageDto } from './dto/create-page.dto';
|
||||
|
||||
@Controller('page')
|
||||
export class PageController {
|
||||
constructor(private readonly pageService: PageService) {}
|
||||
|
||||
@Post('create')
|
||||
async create(@Body() createPageDto: CreatePageDto) {
|
||||
return this.pageService.create(createPageDto);
|
||||
}
|
||||
|
||||
@Get('page/:id')
|
||||
async getPage(@Param('id') pageId: string) {
|
||||
return this.pageService.findById(pageId);
|
||||
}
|
||||
|
||||
@Delete('delete/:id')
|
||||
async delete(@Param('id') pageId: string) {
|
||||
await this.pageService.delete(pageId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user