Refactoring

* Refactor workspace membership system
* Create setup endpoint
* Use Passport.js
* Several updates and fixes
This commit is contained in:
Philipinho
2024-03-16 22:58:12 +00:00
parent b42fe48e9b
commit a821e37028
87 changed files with 2703 additions and 2307 deletions

View File

@ -7,13 +7,13 @@ import {
Query,
UseGuards,
} from '@nestjs/common';
import { JwtGuard } from '../auth/guards/jwt.guard';
import { SearchService } from './search.service';
import { SearchDTO } from './dto/search.dto';
import { CurrentWorkspace } from '../../decorators/current-workspace.decorator';
import { AuthWorkspace } from '../../decorators/auth-workspace.decorator';
import { Workspace } from '../workspace/entities/workspace.entity';
import { JwtAuthGuard } from '../../guards/jwt-auth.guard';
@UseGuards(JwtGuard)
@UseGuards(JwtAuthGuard)
@Controller('search')
export class SearchController {
constructor(private readonly searchService: SearchService) {}
@ -23,7 +23,7 @@ export class SearchController {
async pageSearch(
@Query('type') type: string,
@Body() searchDto: SearchDTO,
@CurrentWorkspace() workspace: Workspace,
@AuthWorkspace() workspace: Workspace,
) {
if (!type || type === 'page') {
return this.searchService.searchPage(

View File

@ -1,11 +1,10 @@
import { Module } from '@nestjs/common';
import { SearchController } from './search.controller';
import { SearchService } from './search.service';
import { AuthModule } from '../auth/auth.module';
import { PageModule } from '../page/page.module';
@Module({
imports: [AuthModule, PageModule],
imports: [PageModule],
controllers: [SearchController],
providers: [SearchService],
})