]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/express-utils.ts
Remove activitypub helper
[github/Chocobozzz/PeerTube.git] / server / helpers / express-utils.ts
index 08f77966f29293a503e5589c90af571a612a9059..82dd4c17807006dce47cdfa884974d62082a58f5 100644 (file)
@@ -68,11 +68,11 @@ function badRequest (_req: express.Request, res: express.Response) {
 function createReqFiles (
   fieldNames: string[],
   mimeTypes: { [id: string]: string | string[] },
-  destinations: { [fieldName: string]: string }
+  destination = CONFIG.STORAGE.TMP_DIR
 ): RequestHandler {
   const storage = diskStorage({
     destination: (req, file, cb) => {
-      cb(null, destinations[file.fieldname])
+      cb(null, destination)
     },
 
     filename: (req, file, cb) => {
@@ -93,12 +93,11 @@ function createReqFiles (
 
 function createAnyReqFiles (
   mimeTypes: { [id: string]: string | string[] },
-  destinationDirectory: string,
   fileFilter: (req: express.Request, file: Express.Multer.File, cb: (err: Error, result: boolean) => void) => void
 ): RequestHandler {
   const storage = diskStorage({
     destination: (req, file, cb) => {
-      cb(null, destinationDirectory)
+      cb(null, CONFIG.STORAGE.TMP_DIR)
     },
 
     filename: (req, file, cb) => {