Update the Book Show LiveView to show the identifiers.
continuous-integration/drone/push Build is passing Details

dev
KKlochko 2 months ago
parent 7b2c726b2c
commit 9115d6f596

@ -68,6 +68,12 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Language</dt>
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">{@book.language}</dd>
</dl>
<dl>
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Identifiers</dt>
<%= for bid <- @book.bids do %>
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">{bid.type}: {bid.bid}</dd>
<% end %>
</dl>
</div>
<%= if not Enum.empty?(@alternative_editions) do %>
@ -93,7 +99,7 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
@impl true
def handle_params(%{"id" => id}, _, socket) do
book = Ash.get!(Metadata.Book, id, actor: socket.assigns.current_user, load: [:author_roles, :publisher])
book = Ash.get!(Metadata.Book, id, actor: socket.assigns.current_user, load: [:bids, :author_roles, :publisher])
alternative_editions = Metadata.get_book_alternative_editions!(book)
{:noreply,

Loading…
Cancel
Save