[day-02] add context to create/get a user

Create context module to create and fetch a user.
This commit is contained in:
Joao P Dubas
2021-06-22 23:57:10 +00:00
parent d578bc6cf3
commit 3709cd265a
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
defmodule Wabanex.Users.Create do
alias Wabanex.{Repo, User}
def call(params) do
params
|> User.changeset()
|> Repo.insert()
end
end