diff --git a/src/frontend/src/components/forms/ApiForm.tsx b/src/frontend/src/components/forms/ApiForm.tsx
index 97ee69e2e8..9e9a432f8d 100644
--- a/src/frontend/src/components/forms/ApiForm.tsx
+++ b/src/frontend/src/components/forms/ApiForm.tsx
@@ -43,10 +43,12 @@ export type ApiFormFieldType = {
*/
function ApiFormField({
field,
- definitions
+ definitions,
+ onValueChange
}: {
field: ApiFormFieldType;
definitions: ApiFormFieldType[];
+ onValueChange: (fieldName: string, value: any) => void;
}) {
// Extract field definition from provided data
// Where user has provided specific data, override the API definition
@@ -66,17 +68,39 @@ function ApiFormField({
return def;
}, [field, definitions]);
+ // Callback helper when form value changes
+ function onChange(value: any) {
+ onValueChange(definition.name, value);
+ }
+
switch (definition.fieldType) {
case 'url':
case 'string':
- return ;
+ return (
+ onChange(event.currentTarget.value)}
+ />
+ );
case 'boolean':
- return ;
+ return (
+ onChange(event.currentTarget.checked)}
+ />
+ );
case 'integer':
case 'decimal':
case 'float':
case 'number':
- return ;
+ return (
+ onChange(value)}
+ />
+ );
default:
return (
@@ -251,6 +275,7 @@ export function ApiForm({
key={field.name}
field={field}
definitions={fieldDefinitions}
+ onValueChange={(fieldName, value) => {}}
/>
))}