This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user