Reorganizing page

This commit is contained in:
Jamil Bou Kheir
2020-05-10 11:55:01 -05:00
parent cc287a7681
commit cb4c4ad8f5
8 changed files with 2 additions and 26 deletions

View File

@@ -1,7 +0,0 @@
defmodule CfHttpWeb.PageController do
use CfHttpWeb, :controller
def index(conn, _params) do
render(conn, "index.html")
end
end

View File

@@ -4,7 +4,7 @@ defmodule CfHttpWeb.UserController do
"""
use CfHttpWeb, :controller
alias CfHttp.{Repo, User}
alias CfHttp.{Repo, Users.User}
plug CfHttpWeb.Plugs.Authenticator when action in [:show, :edit, :update, :delete]

View File

@@ -4,7 +4,7 @@ defmodule CfHttpWeb.Plugs.Authenticator do
"""
import Plug.Conn
alias CfHttp.User
alias CfHttp.Users.User
def init(default), do: default

View File

@@ -16,8 +16,6 @@ defmodule CfHttpWeb.Router do
scope "/", CfHttpWeb do
pipe_through :browser
get "/", PageController, :index
resources "/user", UserController, singleton: true, only: [:show, :edit, :update, :delete]
resources "/users", UserController, only: [:new, :create]

View File

@@ -1,3 +0,0 @@
defmodule CfHttpWeb.PageView do
use CfHttpWeb, :view
end

View File

@@ -1,8 +0,0 @@
defmodule CfHttpWeb.PageControllerTest do
use CfHttpWeb.ConnCase
test "GET /", %{conn: conn} do
conn = get(conn, "/")
assert html_response(conn, 200) =~ "Welcome!"
end
end

View File

@@ -1,3 +0,0 @@
defmodule CfHttpWeb.PageViewTest do
use CfHttpWeb.ConnCase, async: true
end