File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
adminforth/dataConnectors Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,13 @@ export default class AdminForthBaseConnector implements IAdminForthDataSourceCon
271271 }
272272 throw new Error ( `Value is not a decimal. Field ${ field . name } with type is ${ field . type } , but got value: ${ value } with type ${ typeof value } ` ) ;
273273 }
274+ // Accept number
275+ if ( typeof value === "number" ) {
276+ if ( Number . isFinite ( value ) ) {
277+ return this . setFieldValue ( field , value . toString ( ) ) ;
278+ }
279+ throw new Error ( `Value is not a decimal. Field ${ field . name } with type is ${ field . type } , but got value: ${ value } with type ${ typeof value } ` ) ;
280+ }
274281 // Accept Decimal-like objects (e.g., decimal.js) by using toString()
275282 if ( value && typeof value === "object" && typeof ( value as any ) . toString === "function" ) {
276283 const s = ( value as any ) . toString ( ) ;
You can’t perform that action at this time.
0 commit comments