* 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.
37 lines
1.3 KiB
TOML
37 lines
1.3 KiB
TOML
[workspace]
|
|
resolver = "2"
|
|
members = [
|
|
"crates/server",
|
|
"crates/db",
|
|
"crates/executors",
|
|
"crates/services",
|
|
"crates/utils",
|
|
"crates/local-deployment",
|
|
"crates/deployment",
|
|
"crates/remote",
|
|
"crates/review"
|
|
]
|
|
|
|
[workspace.dependencies]
|
|
tokio = { version = "1.0", features = ["full"] }
|
|
axum = { version = "0.8.4", features = ["macros", "multipart", "ws"] }
|
|
tower-http = { version = "0.5", features = ["cors", "request-id", "trace", "fs"] }
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = { version = "1.0", features = ["preserve_order"] }
|
|
anyhow = "1.0"
|
|
git2 = { version = "0.20.3", default-features = false }
|
|
reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "rustls-tls-webpki-roots-no-provider"] }
|
|
rustls = { version = "0.23", default-features = false, features = ["aws_lc_rs", "std", "tls12"] }
|
|
thiserror = "2.0.12"
|
|
tracing = "0.1.43"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt", "json"] }
|
|
ts-rs = { git = "https://github.com/xazukx/ts-rs.git", branch = "use-ts-enum", features = ["uuid-impl", "chrono-impl", "no-serde-warnings", "serde-json-impl"] }
|
|
schemars = { version = "1.0.4", features = ["derive", "chrono04", "uuid1", "preserve_order"] }
|
|
serde_with = "3"
|
|
async-trait = "0.1"
|
|
|
|
[profile.release]
|
|
debug = 1
|
|
split-debuginfo = "packed"
|
|
strip = true
|