Created
July 2, 2020 09:46
-
-
Save velotiotech/e9efd0c7c2d71ce4e880887f2f4f2226 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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