* All tasks are complete. Here's a summary of the changes made:
## Summary
Fixed the issue where `ScriptFixerDialog.tsx` was replacing cleanup and setup scripts with `null` when editing a dev server script.
### Changes Made:
1. **Added `serde_with` dependency** (`Cargo.toml` and `crates/db/Cargo.toml`)
- Added `serde_with = "3"` to enable the double option pattern
2. **Updated `UpdateRepo` struct** (`crates/db/src/models/repo.rs`)
- Changed all fields from `Option<T>` to `Option<Option<T>>` with the `double_option` serde helper
- Added `#[ts(optional, type = "...")]` annotations for proper TypeScript type generation
3. **Updated `Repo::update` method** (`crates/db/src/models/repo.rs`)
- Now properly handles three states:
- `None` = field absent → preserve existing value
- `Some(None)` = explicitly null → set to NULL
- `Some(Some(v))` = has value → update to value
4. **Updated `ScriptFixerDialog.tsx`** (`frontend/src/components/dialogs/scripts/ScriptFixerDialog.tsx`)
- Changed `handleSave` and `handleSaveAndTest` to only send the field being edited
- Removed `repos` from the dependency arrays since it's no longer used in the save functions
5. **Regenerated TypeScript types**
- `UpdateRepo` now has all fields as optional: `field?: type | null`
### Result:
The API now supports true partial updates. Clients can send only the fields they want to update, and existing values are preserved for omitted fields. Sending `null` explicitly will clear a field to NULL.
* Done. All Rust code has been formatted.
1.3 KiB
1.3 KiB