Skip to content
Snippets Groups Projects
Commit 6f90e0ab authored by L4168's avatar L4168
Browse files

added Interceptors

parent 413df661
No related branches found
No related tags found
Loading
...@@ -7,6 +7,8 @@ import { ...@@ -7,6 +7,8 @@ import {
Body, Body,
Get, Get,
Put, Put,
UseInterceptors,
ClassSerializerInterceptor,
} from '@nestjs/common'; } from '@nestjs/common';
import { AuthGuard } from '../shared/auth.guard'; import { AuthGuard } from '../shared/auth.guard';
...@@ -56,6 +58,7 @@ export class FactionController { ...@@ -56,6 +58,7 @@ export class FactionController {
return this.factionservice.joinGroup(person, id, data); return this.factionservice.joinGroup(person, id, data);
} }
@UseInterceptors(ClassSerializerInterceptor)
@Get('get-faction-members/:id') @Get('get-faction-members/:id')
async getFactionMembers(@Param('id') factionId) { async getFactionMembers(@Param('id') factionId) {
return this.factionservice.listFactionMembers(factionId); return this.factionservice.listFactionMembers(factionId);
......
...@@ -7,6 +7,8 @@ import { ...@@ -7,6 +7,8 @@ import {
Param, Param,
UsePipes, UsePipes,
Put, Put,
UseInterceptors,
ClassSerializerInterceptor,
} from '@nestjs/common'; } from '@nestjs/common';
import { GameService } from './game.service'; import { GameService } from './game.service';
...@@ -39,6 +41,8 @@ export class GameController { ...@@ -39,6 +41,8 @@ export class GameController {
return this.gameservice.listGames(); return this.gameservice.listGames();
} }
// ClassSerializerInterceptor removes excluded columns set in Entities
@UseInterceptors(ClassSerializerInterceptor)
@Get(':id') @Get(':id')
async returnGameInfo(@Param('id') id: string) { async returnGameInfo(@Param('id') id: string) {
return this.gameservice.returnGameInfo(id); return this.gameservice.returnGameInfo(id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment