Remove ecto repo, add writing to file
This commit is contained in:
parent
386a331956
commit
ce463329f6
20 changed files with 98 additions and 122 deletions
|
|
@ -4,11 +4,11 @@ defmodule BirdyChatWeb.Api.Messages.Controller do
|
|||
def create(conn, params) do
|
||||
case BirdyChat.Message.validate(params) do
|
||||
{:ok, changeset} ->
|
||||
case BirdyChat.Message.write(changeset.changes) do
|
||||
{:ok, msg} ->
|
||||
case BirdyChat.MessageWriter.write(changeset.changes) do
|
||||
:ok ->
|
||||
conn
|
||||
|> put_status(:created)
|
||||
|> render(:create, message: msg)
|
||||
|> render(:create, message: changeset.changes)
|
||||
end
|
||||
|
||||
{:error, changeset} ->
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ defmodule BirdyChatWeb.Endpoint do
|
|||
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
|
||||
plug Phoenix.LiveReloader
|
||||
plug Phoenix.CodeReloader
|
||||
plug Phoenix.Ecto.CheckRepoStatus, otp_app: :birdy_chat
|
||||
end
|
||||
|
||||
plug Phoenix.LiveDashboard.RequestLogger,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue