bookmarks!

This commit is contained in:
2022-08-03 16:01:41 +02:00
parent 4bd3634abb
commit ae1dc3a216
5 changed files with 49 additions and 4 deletions

View File

@ -15,6 +15,10 @@ defmodule SomethingErlang.Grover do
GenServer.call(via(self()), {:show_thread, thread_id, page_number})
end
def get_bookmarks!(page_number) do
GenServer.call(via(self()), {:show_bookmarks, page_number})
end
def start_link([lv_pid, user]) do
GenServer.start_link(
__MODULE__,
@ -41,6 +45,12 @@ defmodule SomethingErlang.Grover do
{:reply, thread, state}
end
@impl true
def handle_call({:show_bookmarks, _page_number}, _from, state) do
bookmarks = AwfulApi.bookmarks(state.user)
{:reply, bookmarks, state}
end
@impl true
def handle_info({:DOWN, _ref, :process, _object, reason}, state) do
Logger.debug "received :DOWN from: #{inspect(state.lv_pid)} reason: #{inspect(reason)}"