Created
October 17, 2016 20:33
-
-
Save lasseebert/f367e3e4f0ba488b875b9c671349eaee 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 MyApp.UserController do | |
| use MyApp.Web, :controller | |
| def create(conn, params) do | |
| attrs = %{email: params["email"]} | |
| {:ok, user} = MyApp.Users.Invite.call(attrs) | |
| {:ok, body} = %{ | |
| id: user.id, | |
| email: user.email | |
| } | |
| |> Poison.encode | |
| conn | |
| |> resp(201, body) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment