From 9115d6f5965aab05bbe5d29df9dda121630ea527 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Thu, 24 Apr 2025 22:05:44 +0300 Subject: [PATCH] Update the Book Show LiveView to show the identifiers. --- lib/decentralised_book_index_web/live/book_live/show.ex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/decentralised_book_index_web/live/book_live/show.ex b/lib/decentralised_book_index_web/live/book_live/show.ex index f9bfbd8..959de2b 100644 --- a/lib/decentralised_book_index_web/live/book_live/show.ex +++ b/lib/decentralised_book_index_web/live/book_live/show.ex @@ -68,6 +68,12 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
Language
{@book.language}
+
+
Identifiers
+ <%= for bid <- @book.bids do %> +
{bid.type}: {bid.bid}
+ <% end %> +
<%= 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,