Packages

Library for generating inline editable fields with minimal configuration.

Current section

Files

Jump to
phx_in_place lib update_handler.ex
Raw

lib/update_handler.ex

defmodule UpdateHandler do
@moduledoc false
@repo Application.get_env(:phx_in_place, :repo)
def update_repo(struct, id, attrs) do
struct
|> @repo.get!(id)
|> struct.changeset(attrs)
|> @repo.update()
end
end