(values: UserConfig)
| 392 | }); |
| 393 | |
| 394 | const onSubmit = async (values: UserConfig) => { |
| 395 | // Only send values that were actually changed to avoid |
| 396 | // overwriting backend values the form doesn't manage |
| 397 | const dirtyValues = getDirtyValues(values, form.formState.dirtyFields); |
| 398 | if (Object.keys(dirtyValues).length === 0) { |
| 399 | return; // Nothing changed |
| 400 | } |
| 401 | await saveUserConfig({ config: dirtyValues }).then(() => { |
| 402 | // Update local state with form values |
| 403 | setConfig((prev) => ({ ...prev, ...values })); |
| 404 | }); |
| 405 | }; |
| 406 | |
| 407 | return ( |
| 408 | <Form {...form}> |
no test coverage detected
searching dependent graphs…