Trim val before check

h/t @aidenfoxx
This commit is contained in:
rijkvanzanten
2021-06-17 11:20:56 -04:00
parent 02a44c5861
commit 1c727cc48e

View File

@@ -37,9 +37,9 @@ 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 (typeof val === 'string' && val.trim() === 'null') val = null;
if (typeof val === 'string' && val.trim() === 'false') val = false;
if (typeof val === 'string' && val.trim() === 'true') val = true;
if (fieldname === 'storage') {
disk = val;