Skip to content

Commit 3c25f78

Browse files
committed
Revert "fix: accept number type in setFieldValue method for better input handling"
This reverts commit 7f2fbba.
1 parent 7f2fbba commit 3c25f78

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

adminforth/dataConnectors/baseConnector.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,6 @@ 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-
}
281274
// Accept Decimal-like objects (e.g., decimal.js) by using toString()
282275
if (value && typeof value === "object" && typeof (value as any).toString === "function") {
283276
const s = (value as any).toString();

0 commit comments

Comments
 (0)