From b502c0e3ed843a28fcd7268a5d056f8ff1e26bf4 Mon Sep 17 00:00:00 2001 From: Paul Kim Date: Fri, 3 Nov 2023 09:37:07 -0400 Subject: [PATCH] Stub out permanent config operations (#232) * Stub out permanent config operations * credo * Change module name --- lib/screenplay/config/config.ex | 12 +++++++++++ .../controllers/config_controller.ex | 20 +++++++++++++++++++ lib/screenplay_web/router.ex | 14 +++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 lib/screenplay/config/config.ex create mode 100644 lib/screenplay_web/controllers/config_controller.ex diff --git a/lib/screenplay/config/config.ex b/lib/screenplay/config/config.ex new file mode 100644 index 00000000..a386f70b --- /dev/null +++ b/lib/screenplay/config/config.ex @@ -0,0 +1,12 @@ +defmodule Screenplay.Config.PermanentConfig do + @moduledoc false + + def add_new_screen do + end + + def edit_screen do + end + + def delete_screen do + end +end diff --git a/lib/screenplay_web/controllers/config_controller.ex b/lib/screenplay_web/controllers/config_controller.ex new file mode 100644 index 00000000..ba0fb2d9 --- /dev/null +++ b/lib/screenplay_web/controllers/config_controller.ex @@ -0,0 +1,20 @@ +defmodule ScreenplayWeb.ConfigController do + use ScreenplayWeb, :controller + + alias Screenplay.Config.PermanentConfig + + def add(conn, _params) do + PermanentConfig.add_new_screen() + conn + end + + def edit(conn, _params) do + PermanentConfig.edit_screen() + conn + end + + def delete(conn, _params) do + PermanentConfig.delete_screen() + conn + end +end diff --git a/lib/screenplay_web/router.ex b/lib/screenplay_web/router.ex index e43c6284..220dc136 100644 --- a/lib/screenplay_web/router.ex +++ b/lib/screenplay_web/router.ex @@ -96,6 +96,20 @@ defmodule ScreenplayWeb.Router do get("/past_alerts", AlertController, :past_alerts) end + scope "/config", ScreenplayWeb do + pipe_through([ + :redirect_prod_http, + :api, + :browser, + :auth, + :ensure_auth + ]) + + post("/add", ConfigController, :add) + post("/edit", ConfigController, :edit) + post("/delete", ConfigController, :delete) + end + # Enables LiveDashboard only for development # # If you want to use the LiveDashboard in production, you should put