Add the cover_image_url attribute to arguments to create a Book.
This commit is contained in:
@@ -26,18 +26,32 @@ defmodule DecentralisedBookIndex.Metadata do
|
||||
:bids,
|
||||
:author_roles,
|
||||
:publisher_id,
|
||||
{:optional, :cover_image_url},
|
||||
{:optional, :book_editions_registry_id}
|
||||
]
|
||||
|
||||
define :add_book_to_related_editions_registry,
|
||||
action: :add_book_to_related_editions_registry,
|
||||
args: [:title, :description, :language, :format, :page_count, :published, :bids, :author_roles, :publisher_id, :related_book_id]
|
||||
args: [
|
||||
:title,
|
||||
:description,
|
||||
:language,
|
||||
:format,
|
||||
:page_count,
|
||||
:published,
|
||||
:bids,
|
||||
:author_roles,
|
||||
:publisher_id,
|
||||
:related_book_id,
|
||||
{:optional, :cover_image_url}
|
||||
]
|
||||
|
||||
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 :search_book, action: :search, args: [:query]
|
||||
define :update_book, action: :update
|
||||
define :assign_book_cover_image, args: [:cover_image_url], action: :assign_cover_image
|
||||
define :destroy_book, action: :destroy
|
||||
@@ -90,6 +104,7 @@ defmodule DecentralisedBookIndex.Metadata do
|
||||
define :create_author_role, action: :create, args: [:author_id, :order, :role]
|
||||
define :list_author_roles, action: :read
|
||||
define :get_author_role_by_id, args: [:id], action: :by_id
|
||||
define :get_author_roles_by_book_id, args: [:book_id], action: :by_book_id
|
||||
define :update_author_role, action: :update
|
||||
define :destroy_author_role, action: :destroy
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ defmodule DecentralisedBookIndex.Metadata.Book do
|
||||
|
||||
create :create do
|
||||
primary? true
|
||||
accept [:title, :description, :format, :language, :page_count, :published, :publisher_id, :book_editions_registry_id]
|
||||
accept [:title, :description, :format, :language, :page_count, :published, :publisher_id, :cover_image_url, :book_editions_registry_id]
|
||||
argument :bids, {:array, :map}
|
||||
argument :author_roles, {:array, :map}
|
||||
|
||||
@@ -38,7 +38,7 @@ defmodule DecentralisedBookIndex.Metadata.Book do
|
||||
end
|
||||
|
||||
create :add_book_to_related_editions_registry do
|
||||
accept [:title, :description, :format, :language, :page_count, :published, :publisher_id]
|
||||
accept [:title, :description, :format, :language, :page_count, :published, :publisher_id, :cover_image_url]
|
||||
|
||||
argument :related_book_id, :uuid do
|
||||
allow_nil? false
|
||||
|
||||
Reference in New Issue
Block a user