@@ -22,16 +22,7 @@ import { getUrl, updateFile, upload } from './itemFile.schema';
2222import FileItemService from './itemFile.service' ;
2323import { DEFAULT_MAX_FILE_SIZE , MAX_NUMBER_OF_FILES_UPLOAD } from './utils/constants' ;
2424
25- export interface GraaspPluginFileOptions {
26- uploadMaxFileNb ?: number ; // max number of files to upload at a time
27- maxFileSize ?: number ; // max size for an uploaded file in bytes
28- maxMemberStorage ?: number ; // max storage space for a user
29- }
30-
31- const basePlugin : FastifyPluginAsyncTypebox < GraaspPluginFileOptions > = async ( fastify , options ) => {
32- const { uploadMaxFileNb = MAX_NUMBER_OF_FILES_UPLOAD , maxFileSize = DEFAULT_MAX_FILE_SIZE } =
33- options ;
34-
25+ const basePlugin : FastifyPluginAsyncTypebox = async ( fastify ) => {
3526 const fileService = resolveDependency ( FileService ) ;
3627 const itemService = resolveDependency ( ItemService ) ;
3728 const storageService = resolveDependency ( StorageService ) ;
@@ -45,8 +36,8 @@ const basePlugin: FastifyPluginAsyncTypebox<GraaspPluginFileOptions> = async (fa
4536 // fieldSize: 1000000, // Max field value size in bytes (Default: 1MB).
4637 fields : 0 , // Max number of non-file fields (Default: Infinity).
4738 // allow some fields for app data and app setting
48- fileSize : maxFileSize , // For multipart forms, the max file size (Default: Infinity).
49- files : uploadMaxFileNb , // Max number of file fields (Default: Infinity).
39+ fileSize : DEFAULT_MAX_FILE_SIZE , // For multipart forms, the max file size (Default: Infinity).
40+ files : MAX_NUMBER_OF_FILES_UPLOAD , // Max number of file fields (Default: Infinity).
5041 // headerPairs: 2000 // Max number of header key=>value pairs (Default: 2000 - same as node's http).
5142 } ,
5243 } ) ;
0 commit comments