|
|
@ -25,6 +25,10 @@ defmodule DecentralisedBookIndex.Metadata.Book do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resource do
|
|
|
|
|
|
|
|
description "A book's metadata."
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
actions do
|
|
|
|
actions do
|
|
|
|
defaults [:read, :destroy]
|
|
|
|
defaults [:read, :destroy]
|
|
|
|
|
|
|
|
|
|
|
@ -142,6 +146,7 @@ defmodule DecentralisedBookIndex.Metadata.Book do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
read :by_id do
|
|
|
|
read :by_id do
|
|
|
|
|
|
|
|
description "Return the Book by its id."
|
|
|
|
argument :id, :uuid, allow_nil?: false
|
|
|
|
argument :id, :uuid, allow_nil?: false
|
|
|
|
get? true
|
|
|
|
get? true
|
|
|
|
filter expr(id == ^arg(:id))
|
|
|
|
filter expr(id == ^arg(:id))
|
|
|
@ -182,7 +187,10 @@ defmodule DecentralisedBookIndex.Metadata.Book do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
read :search do
|
|
|
|
read :search do
|
|
|
|
|
|
|
|
description "Return a list of Books, optionally filtering by title."
|
|
|
|
|
|
|
|
|
|
|
|
argument :query, :ci_string do
|
|
|
|
argument :query, :ci_string do
|
|
|
|
|
|
|
|
description "Return Books, which titles includes the query."
|
|
|
|
constraints allow_empty?: true
|
|
|
|
constraints allow_empty?: true
|
|
|
|
default ""
|
|
|
|
default ""
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -193,6 +201,8 @@ defmodule DecentralisedBookIndex.Metadata.Book do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
read :search_by_bid do
|
|
|
|
read :search_by_bid do
|
|
|
|
|
|
|
|
description "Return a list of Books, optionally filtering by BookId."
|
|
|
|
|
|
|
|
|
|
|
|
argument :type, :string, allow_nil?: false
|
|
|
|
argument :type, :string, allow_nil?: false
|
|
|
|
argument :bid, :string, allow_nil?: false
|
|
|
|
argument :bid, :string, allow_nil?: false
|
|
|
|
|
|
|
|
|
|
|
|