Skip to content

Commit

Permalink
Add support for verified routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ruilopesm committed Jul 29, 2023
1 parent 31b5797 commit 26c4e02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/bokken_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ defmodule BokkenWeb do
namespace: BokkenWeb,
formats: [:html, :json],
layouts: [html: BokkenWeb.Layouts]

unquote(verified_routes())
end

_ ->
quote do
use Phoenix.Controller, namespace: BokkenWeb
alias BokkenWeb.Router.Helpers, as: Routes
end
end

Expand All @@ -42,9 +45,6 @@ defmodule BokkenWeb do
import Plug.Conn
import BokkenWeb.Gettext
import Bokken.Guards
alias BokkenWeb.Router.Helpers, as: Routes

unquote(verified_routes())
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bokken_web/controllers/file_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ defmodule BokkenWeb.FileController do
{:ok, {:ok, file}} ->
conn
|> put_status(:created)
|> put_resp_header("location", Routes.file_path(conn, :show, file))
|> put_resp_header("location", ~p"/api/files/#{file.id}")
|> render(:show, file: file)

{:ok, {:error, reason}} ->
Expand Down

0 comments on commit 26c4e02

Please sign in to comment.