Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created July 2, 2020 09:46
Show Gist options
  • Save velotiotech/e9efd0c7c2d71ce4e880887f2f4f2226 to your computer and use it in GitHub Desktop.
Save velotiotech/e9efd0c7c2d71ce4e880887f2f4f2226 to your computer and use it in GitHub Desktop.
def update(%{id: id, post: post_params}, _info) do
case find(%{id: id}, _info) do
{:ok, post} -> post |> Blog.update_post(post_params)
{:error, _} -> {:error, "Post id #{id} not found"}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment