Browse Source

fix: replace FilesInterceptor with FilesInterceptor

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
965ff749ee
  1. 12
      packages/nocodb-nest/src/modules/attachments/attachments.controller.ts

12
packages/nocodb-nest/src/modules/attachments/attachments.controller.ts

@ -2,7 +2,8 @@ import path from 'path';
import { import {
Body, Body,
Controller, Controller,
Get, HttpCode, Get,
HttpCode,
Param, Param,
Post, Post,
Query, Query,
@ -11,13 +12,14 @@ import {
UploadedFiles, UploadedFiles,
UseGuards, UseGuards,
UseInterceptors, UseInterceptors,
} from '@nestjs/common' } from '@nestjs/common';
import multer from 'multer'; import multer from 'multer';
import { FilesInterceptor } from '@nestjs/platform-express'; import {
AnyFilesInterceptor,
} from '@nestjs/platform-express';
import { AuthGuard } from '@nestjs/passport'; import { AuthGuard } from '@nestjs/passport';
import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants'; import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants';
import { UploadAllowedInterceptor } from '../../interceptors/is-upload-allowed/is-upload-allowed.interceptor'; import { UploadAllowedInterceptor } from '../../interceptors/is-upload-allowed/is-upload-allowed.interceptor';
import { ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware'
import { AttachmentsService } from './attachments.service'; import { AttachmentsService } from './attachments.service';
@Controller() @Controller()
@ -43,7 +45,7 @@ export class AttachmentsController {
@HttpCode(200) @HttpCode(200)
@UseInterceptors( @UseInterceptors(
UploadAllowedInterceptor, UploadAllowedInterceptor,
FilesInterceptor('files', null, { AnyFilesInterceptor({
storage: multer.diskStorage({}), storage: multer.diskStorage({}),
// limits: { // limits: {
// fieldSize: NC_ATTACHMENT_FIELD_SIZE, // fieldSize: NC_ATTACHMENT_FIELD_SIZE,

Loading…
Cancel
Save