How to make an update for fields by type in Inferencer?
Inferencer didn't update component by type field
object type fields, changing the type of a field, or changing the resource for a type, you can use the prop in Inferencer components. undefined, false, or null is returned, the field will be removed from the output, both for the preview and the code.input type to number, but when the user edited the field, the value sent to the server was of a string type. The issue was resolved by adding to the register options.accessorrelationfieldTransformerfieldTransformerfieldTransformervalueAsNumber: true<Inferencer
fieldTransformer={(field) => {
if (field.type === 'yourDesiredType') {
return {
...field,
// your customizations here
};
}
return field;
}}
/><FormControl mb="3" isInvalid={!!(errors as any)?.outstanding_amount}>
<FormLabel>Outstanding Amount</FormLabel>
<Input
type="number"
{...register("outstanding_amount", {
required: "This field is required",
valueAsNumber: true,
})}
/>
<FormErrorMessage>
{(errors as any)?.outstanding_amount?.message as string}
</FormErrorMessage>
</FormControl>