Skip to main content

settings_update

Function settings_update 

Source
pub async fn settings_update(
    handle: State<'_, SettingsHandle>,
    pool: State<'_, S3ClientPoolHandle>,
    queue: State<'_, TransferQueueHandle>,
    patch: Value,
    force: Option<bool>,
) -> Result<Settings, AppError>
Expand description

Apply a JSON patch to the current settings, validate, and persist.

patch is a partial JSON object; only the keys present in patch are updated. The merge strategy is a shallow JSON merge (RFC 7396 spirit): top-level keys in patch overwrite the corresponding fields in the stored settings. Sub-structs are replaced wholesale when their key appears in patch (standard serde_json::Value merge semantics).

Returns the updated Settings on success, or AppError::Validation if the patch violates a constraint (e.g. transferConcurrency = 0).

Pass force: true to bypass shortcut-conflict checks (future use; ignored in v1 but accepted so callers compiled against this signature do not need updating).