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:
Philipinho
2023-08-22 19:48:57 +01:00
parent c0b2bc1f57
commit f11f9f6210
14 changed files with 282 additions and 52 deletions

View 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);
}
}