Skip to content

Commit

Permalink
Increase file upload limit in create-item-controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy committed Jun 1, 2024
1 parent ad116c2 commit 6de30c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server/controllers/item/create-item-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ import { DataParsingException } from "../../errors/data-parsing-exception"
import { itemErrorHandler } from "./shared/item-error-handler"

const pg = pgp()
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
const FILE_LIMIT = 5120 * 1024 * 1024

Check warning on line 35 in src/server/controllers/item/create-item-controller.ts

View check run for this annotation

Codecov / codecov/patch

src/server/controllers/item/create-item-controller.ts#L35

Added line #L35 was not covered by tests

const upload = multer(
{
dest: "./uploads",
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
limits: { fieldSize: 2048 * 1024 * 1024 },
limits: { fieldSize: FILE_LIMIT },
}).fields([
{ name: "kpi", maxCount: 1 },
{ name: "monitoring", maxCount: 1 },
Expand Down

0 comments on commit 6de30c0

Please sign in to comment.