Skip to main content

update

Function update 

Source
pub async fn update(
    session: Session,
    __arg1: Path<String>,
    __arg2: Json<UpdatePayload>,
) -> Result<Response<Body>, AppError>
Expand description

POST /__larust_wire/{component_id} - handles both a wire:model-style prop sync and a wire:click-style action call in one request (see UpdatePayload): every sync carries the component’s entire current wire:model field set, not a delta, which is what correctly threads a deferred field’s just-typed value through when a different element’s click/wire-sync is what actually triggers the request.

The whole sync is atomic: if the prop merge or the action call fails, nothing is written back to the session - the previously-stored state is left untouched. Response is 200 text/html, the same <div data-wire-id="..."> wrapper shape mount() produces.