Skip to content

Commit 00aadbb

Browse files
committed
feat: accept finite numbers from JSON/OpenAPI clients in setFieldValue
1 parent a61189c commit 00aadbb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

adminforth/dataConnectors/baseConnector.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ export default class AdminForthBaseConnector implements IAdminForthDataSourceCon
397397
if (value === "" || value === null) {
398398
return this.setFieldValue(field, null);
399399
}
400+
// Accept numbers from JSON/OpenAPI clients.
401+
if (typeof value === "number" && Number.isFinite(value)) {
402+
return this.setFieldValue(field, String(value));
403+
}
400404
// Accept string
401405
if (typeof value === "string") {
402406
const string = value.trim();
@@ -665,4 +669,4 @@ export default class AdminForthBaseConnector implements IAdminForthDataSourceCon
665669
}
666670

667671

668-
}
672+
}

0 commit comments

Comments
 (0)