Last active
May 7, 2017 09:36
-
-
Save sobolevn/4f6d98afd2b10754ffb2b83609c5ae0f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
defmodule MediumPhxExample.Web.AlbumController do | |
use MediumPhxExample.Web, :controller | |
alias MediumPhxExample.Audio | |
alias MediumPhxExample.Audio.Album | |
action_fallback MediumPhxExample.Web.FallbackController | |
# ... | |
def update(conn, %{"id" => id, "album" => album_params}) do | |
album = Audio.get_album!(id) | |
with {:ok, %Album{} = album} <- Audio.update_album(album, album_params) do | |
render(conn, "show.json", album: album) | |
end | |
end | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment