Skip to content

Commit

Permalink
remove unneeded import multer
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat committed Jan 19, 2024
1 parent 44eb1e9 commit 0efb3ab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
2 changes: 0 additions & 2 deletions server/endpoints/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ const {
queryParams,
} = require("../utils/http");
const {
setupDataImports,
setupLogoUploads,
setupPfpUploads,
} = require("../utils/files/multer");
const { v4 } = require("uuid");
const { SystemSettings } = require("../models/systemSettings");
const { User } = require("../models/user");
const { validatedRequest } = require("../utils/middleware/validatedRequest");
const { handleImports } = setupDataImports();
const { handleLogoUploads } = setupLogoUploads();
const { handlePfpUploads } = setupPfpUploads();
const fs = require("fs");
Expand Down
17 changes: 0 additions & 17 deletions server/utils/files/multer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@ function setupMulter() {
return { handleUploads: multer({ storage }) };
}

function setupDataImports() {
// Handle File uploads for auto-uploading.
const storage = multer.diskStorage({
destination: function (_, __, cb) {
const uploadOutput = path.resolve(__dirname, `../../storage/imports`);
fs.mkdirSync(uploadOutput, { recursive: true });
return cb(null, uploadOutput);
},
filename: function (_, file, cb) {
cb(null, file.originalname);
},
});

return { handleImports: multer({ storage }) };
}

function setupLogoUploads() {
// Handle Logo uploads.
const storage = multer.diskStorage({
Expand Down Expand Up @@ -84,7 +68,6 @@ function setupPfpUploads() {

module.exports = {
setupMulter,
setupDataImports,
setupLogoUploads,
setupPfpUploads,
};

0 comments on commit 0efb3ab

Please sign in to comment.