Current section
Files
Jump to
Current section
Files
doc/AshGleam.Changeset.md
# `AshGleam.Changeset`
Builds an `Ash.Changeset` from a Gleam update-style action without persisting.
# `for_update`
```elixir
@spec for_update(struct(), atom(), map(), Keyword.t()) ::
{:ok, Ash.Changeset.t()} | {:error, term()}
```
Runs a Gleam action marked `update? true` and returns an `Ash.Changeset` ready for persistence.
## Options
* `:action` (required) - the Ash update action to build the changeset with
## Example
todo
|> AshGleam.Changeset.for_update(:mark_completed, %{}, action: :update)
|> Ash.update!()
---
*Consult [api-reference.md](api-reference.md) for complete listing*