Skip to content

Commit

Permalink
fix: do not convert null or undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
dziraf authored Dec 11, 2023
1 parent 21709ac commit 3cfb90c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/param-converter/convert-param.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const convertParam = (value: any, propertyType: string): any => {
if (value === null || typeof value === 'undefined') {
return value
}

if (propertyType === 'number') {
return Number(value)
}
Expand All @@ -7,7 +11,7 @@ const convertParam = (value: any, propertyType: string): any => {
return Boolean(value)
}

if (['datetime', 'date'].includes(propertyType) && value !== null) {
if (['datetime', 'date'].includes(propertyType)) {
return new Date(value)
}

Expand Down

0 comments on commit 3cfb90c

Please sign in to comment.