Files
vibe-kanban/crates/db/Cargo.toml
Louis Knight-Webb ede1511a50 fix: ScriptFixerDialog no longer overwrites unrelated scripts (Vibe Kanban) (#2078)
* 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.
2026-01-15 15:49:01 +00:00

22 lines
647 B
TOML

[package]
name = "db"
version = "0.0.153"
edition = "2024"
[dependencies]
utils = { path = "../utils" }
executors = { path = "../executors" }
thiserror = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
anyhow = { workspace = true }
tracing = { workspace = true }
sqlx = { version = "0.8.6", features = ["runtime-tokio", "tls-rustls-aws-lc-rs", "sqlite", "sqlite-preupdate-hook", "chrono", "uuid"] }
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1.0", features = ["v4", "serde"] }
ts-rs = { workspace = true }
serde_with = { workspace = true }
strum = "0.27.2"
strum_macros = "0.27.2"