Add the action to get Book by a BookId.
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-14 11:53:04 +02:00
parent 23cfb1009a
commit 5f064a3235
3 changed files with 30 additions and 0 deletions
+1
View File
@@ -30,6 +30,7 @@ defmodule DecentralisedBookIndex.Metadata do
define :list_books, action: :read
define :get_book_by_id, args: [:id], action: :by_id
define :get_book_by_bid, args: [:type, :bid], action: :by_bid
define :get_book_alternative_editions, args: [:book], action: :get_alternative_editions
define :get_author_books, args: [:author], action: :get_author_books
define :update_book, action: :update
@@ -69,6 +69,13 @@ defmodule DecentralisedBookIndex.Metadata.Book do
filter expr(id == ^arg(:id))
end
read :by_bid do
argument :type, :string, allow_nil?: false
argument :bid, :string, allow_nil?: false
get? true
filter expr(exists(bids, type == ^arg(:type) and bid == ^arg(:bid)))
end
read :get_alternative_editions do
argument :book, :struct, allow_nil?: false