Skip to content

Commit

Permalink
Add basic typecast in multipart fields
Browse files Browse the repository at this point in the history
fixes #6310
  • Loading branch information
rijkvanzanten committed Jun 17, 2021
1 parent a835630 commit 6db691a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/src/controllers/files.ts
Expand Up @@ -37,6 +37,10 @@ const multipartHandler = asyncHandler(async (req, res, next) => {
let fileCount = 0;

busboy.on('field', (fieldname: keyof File, val) => {
if (val === 'null') val = null;
if (val === 'false') val = false;
if (val === 'true') val = true;

if (fieldname === 'storage') {
disk = val;
}
Expand Down

0 comments on commit 6db691a

Please sign in to comment.