Skip to content

Commit

Permalink
Stub out permanent config operations (#232)
Browse files Browse the repository at this point in the history
* Stub out permanent config operations

* credo

* Change module name
  • Loading branch information
PaulJKim authored Nov 3, 2023
1 parent 8e17174 commit b502c0e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/screenplay/config/config.ex
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions lib/screenplay_web/controllers/config_controller.ex
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions lib/screenplay_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b502c0e

Please sign in to comment.