routes and views
This commit is contained in:
29
lib/something_erlang_web/live/bookmarks_live/show.ex
Normal file
29
lib/something_erlang_web/live/bookmarks_live/show.ex
Normal file
@ -0,0 +1,29 @@
|
||||
defmodule SomethingErlangWeb.BookmarksLive.Show do
|
||||
use SomethingErlangWeb, :live_view
|
||||
on_mount SomethingErlangWeb.UserLiveAuth
|
||||
|
||||
#alias SomethingErlang.Grover
|
||||
|
||||
require Logger
|
||||
|
||||
@impl true
|
||||
def mount(_params, _session, socket) do
|
||||
#Grover.mount(socket.assigns.current_user, id)
|
||||
{:ok, socket}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_params(%{"page" => page}, _, socket) do
|
||||
#thread = Grover.get_thread!(id, page |> String.to_integer())
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(:page_title, "bookmarks")}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_params(_, _, socket) do
|
||||
{:noreply, push_redirect(socket,
|
||||
to: Routes.bookmarks_show_path(socket, :show, page: 1))}
|
||||
end
|
||||
|
||||
end
|
@ -30,6 +30,12 @@ defmodule SomethingErlangWeb.Router do
|
||||
live "/:id", ThreadLive.Show, :show
|
||||
end
|
||||
|
||||
scope "/bookmarks", SomethingErlangWeb do
|
||||
pipe_through :browser
|
||||
|
||||
live "/", BookmarksLive.Show, :show
|
||||
end
|
||||
|
||||
scope "/admin", SomethingErlangWeb do
|
||||
pipe_through [:browser, :require_authenticated_user]
|
||||
|
||||
|
Reference in New Issue
Block a user