File size: 913 Bytes
fb13f0c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
import { PreviewModeGuard } from './preview-mode.guard';
import { PreviewService } from './preview.service';

@Controller('preview')
@UseGuards(PreviewModeGuard)
export class PreviewController {
  constructor(private readonly previewService: PreviewService) {}

  @Get('config')
  getConfig() {
    return this.previewService.getConfig();
  }

  @Get('feed')
  getFeed() {
    return this.previewService.getFeed();
  }

  @Get('characters')
  getCharacters() {
    return this.previewService.getCharacters();
  }

  @Get('characters/:slug')
  getCharacter(@Param('slug') slug: string) {
    return this.previewService.getCharacter(slug);
  }

  @Get('chats')
  getChats() {
    return this.previewService.getChats();
  }

  @Get('chats/:chatId')
  getChat(@Param('chatId') chatId: string) {
    return this.previewService.getChat(chatId);
  }
}