From cb4c4ad8f52f5490f38c1c759c7bebfd71e18e1e Mon Sep 17 00:00:00 2001 From: Jamil Bou Kheir Date: Sun, 10 May 2020 11:55:01 -0500 Subject: [PATCH] Reorganizing page --- .../lib/cf_http_web/controllers/page_controller.ex | 7 ------- .../lib/cf_http_web/controllers/user_controller.ex | 2 +- apps/cf_http/lib/cf_http_web/plugs/authenticator.ex | 2 +- apps/cf_http/lib/cf_http_web/router.ex | 2 -- .../cf_http/lib/cf_http_web/templates/page/index.html.eex | 1 - apps/cf_http/lib/cf_http_web/views/page_view.ex | 3 --- .../test/cf_http_web/controllers/page_controller_test.exs | 8 -------- apps/cf_http/test/cf_http_web/views/page_view_test.exs | 3 --- 8 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 apps/cf_http/lib/cf_http_web/controllers/page_controller.ex delete mode 100644 apps/cf_http/lib/cf_http_web/templates/page/index.html.eex delete mode 100644 apps/cf_http/lib/cf_http_web/views/page_view.ex delete mode 100644 apps/cf_http/test/cf_http_web/controllers/page_controller_test.exs delete mode 100644 apps/cf_http/test/cf_http_web/views/page_view_test.exs diff --git a/apps/cf_http/lib/cf_http_web/controllers/page_controller.ex b/apps/cf_http/lib/cf_http_web/controllers/page_controller.ex deleted file mode 100644 index e122f634b..000000000 --- a/apps/cf_http/lib/cf_http_web/controllers/page_controller.ex +++ /dev/null @@ -1,7 +0,0 @@ -defmodule CfHttpWeb.PageController do - use CfHttpWeb, :controller - - def index(conn, _params) do - render(conn, "index.html") - end -end diff --git a/apps/cf_http/lib/cf_http_web/controllers/user_controller.ex b/apps/cf_http/lib/cf_http_web/controllers/user_controller.ex index 2ee715eb5..aea355e96 100644 --- a/apps/cf_http/lib/cf_http_web/controllers/user_controller.ex +++ b/apps/cf_http/lib/cf_http_web/controllers/user_controller.ex @@ -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] diff --git a/apps/cf_http/lib/cf_http_web/plugs/authenticator.ex b/apps/cf_http/lib/cf_http_web/plugs/authenticator.ex index 19c661615..194cfa50b 100644 --- a/apps/cf_http/lib/cf_http_web/plugs/authenticator.ex +++ b/apps/cf_http/lib/cf_http_web/plugs/authenticator.ex @@ -4,7 +4,7 @@ defmodule CfHttpWeb.Plugs.Authenticator do """ import Plug.Conn - alias CfHttp.User + alias CfHttp.Users.User def init(default), do: default diff --git a/apps/cf_http/lib/cf_http_web/router.ex b/apps/cf_http/lib/cf_http_web/router.ex index 9239afc28..0cb9747fd 100644 --- a/apps/cf_http/lib/cf_http_web/router.ex +++ b/apps/cf_http/lib/cf_http_web/router.ex @@ -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] diff --git a/apps/cf_http/lib/cf_http_web/templates/page/index.html.eex b/apps/cf_http/lib/cf_http_web/templates/page/index.html.eex deleted file mode 100644 index d8e9d74ba..000000000 --- a/apps/cf_http/lib/cf_http_web/templates/page/index.html.eex +++ /dev/null @@ -1 +0,0 @@ -Welcome! diff --git a/apps/cf_http/lib/cf_http_web/views/page_view.ex b/apps/cf_http/lib/cf_http_web/views/page_view.ex deleted file mode 100644 index 6e3a53c9d..000000000 --- a/apps/cf_http/lib/cf_http_web/views/page_view.ex +++ /dev/null @@ -1,3 +0,0 @@ -defmodule CfHttpWeb.PageView do - use CfHttpWeb, :view -end diff --git a/apps/cf_http/test/cf_http_web/controllers/page_controller_test.exs b/apps/cf_http/test/cf_http_web/controllers/page_controller_test.exs deleted file mode 100644 index a42397504..000000000 --- a/apps/cf_http/test/cf_http_web/controllers/page_controller_test.exs +++ /dev/null @@ -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 diff --git a/apps/cf_http/test/cf_http_web/views/page_view_test.exs b/apps/cf_http/test/cf_http_web/views/page_view_test.exs deleted file mode 100644 index d3f100c9a..000000000 --- a/apps/cf_http/test/cf_http_web/views/page_view_test.exs +++ /dev/null @@ -1,3 +0,0 @@ -defmodule CfHttpWeb.PageViewTest do - use CfHttpWeb.ConnCase, async: true -end