Add the Author resource.

This commit is contained in:
2025-03-05 21:54:16 +02:00
parent 7fc50ca8d5
commit d8fb41e08c
2 changed files with 26 additions and 0 deletions
+1
View File
@@ -4,5 +4,6 @@ defmodule DecentralisedBookIndex.Metadata do
resources do resources do
resource DecentralisedBookIndex.Metadata.Book resource DecentralisedBookIndex.Metadata.Book
resource DecentralisedBookIndex.Metadata.Author
end end
end end
@@ -0,0 +1,25 @@
defmodule DecentralisedBookIndex.Metadata.Author do
use Ash.Resource,
otp_app: :decentralised_book_index,
domain: DecentralisedBookIndex.Metadata
actions do
defaults [:read]
end
attributes do
uuid_primary_key :id
attribute :name, :string do
allow_nil? false
public? true
end
attribute :description, :string do
allow_nil? false
public? true
end
timestamps()
end
end