|
|
@@ -1,4 +1,4 @@
|
|
|
-import { Body, Controller, Get, Post, Render, Req, UploadedFile, UseInterceptors } from '@nestjs/common'
|
|
|
+import { Body, Controller, Get, Post, Render, Req, UploadedFile, UseInterceptors, Param } from '@nestjs/common'
|
|
|
import { Public } from '../auth/public.decorator'
|
|
|
import { FileInterceptor } from '@nestjs/platform-express'
|
|
|
import { ChatPdfService } from './chat-pdf.service'
|
|
|
@@ -8,10 +8,10 @@ export class ChatPdfController {
|
|
|
constructor(private readonly chatPdfService: ChatPdfService) {}
|
|
|
|
|
|
@Public()
|
|
|
- @Post('upload')
|
|
|
+ @Post('upload/:code')
|
|
|
@UseInterceptors(FileInterceptor('file'))
|
|
|
- public async uploadFile(@UploadedFile() file: Express.Multer.File, @Req() req) {
|
|
|
- return await this.chatPdfService.upload(file, req.user.id)
|
|
|
+ public async uploadFile(@UploadedFile() file: Express.Multer.File, @Param('code') code: string) {
|
|
|
+ return await this.chatPdfService.upload(file, code)
|
|
|
}
|
|
|
|
|
|
// @Public()
|