| 617 | |
| 618 | |
| 619 | async def save_form_config( |
| 620 | form_data: Mapping[str, Any], |
| 621 | *, |
| 622 | reload_callback: ReloadCallback, |
| 623 | env_path: str | Path = ENV_PATH, |
| 624 | ) -> dict[str, object]: |
| 625 | updates = build_form_updates(form_data) |
| 626 | |
| 627 | async def _reload() -> None: |
| 628 | await reload_callback() |
| 629 | |
| 630 | def _writer(target_path: Path) -> None: |
| 631 | update_env_file(updates, env_path=target_path) |
| 632 | |
| 633 | await _apply_env_change(_writer, reload_callback=_reload, env_path=env_path) |
| 634 | return updates |
| 635 | |
| 636 | |
| 637 | async def save_source_config( |