Update Author resource and test for the form.
This commit is contained in:
@@ -31,8 +31,8 @@ defmodule DecentralisedBookIndex.Metadata.Author do
|
||||
registry_id = Ash.Changeset.get_attribute(changeset, :author_alias_registry_id)
|
||||
|
||||
if registry_id == nil do
|
||||
{:ok, registry} =
|
||||
DecentralisedBookIndex.Metadata.create_author_alias_registry(actor: actor)
|
||||
registry =
|
||||
DecentralisedBookIndex.Metadata.create_author_alias_registry!(actor: actor)
|
||||
|
||||
Ash.Changeset.force_change_attribute(changeset, :author_alias_registry_id, registry.id)
|
||||
else
|
||||
@@ -54,8 +54,8 @@ defmodule DecentralisedBookIndex.Metadata.Author do
|
||||
if related_author_id == nil do
|
||||
Ash.Changeset.add_error(changeset, :related_author_id, "Related author is empty")
|
||||
else
|
||||
{:ok, related_author} =
|
||||
DecentralisedBookIndex.Metadata.get_author_by_id(related_author_id)
|
||||
related_author =
|
||||
DecentralisedBookIndex.Metadata.get_author_by_id!(related_author_id)
|
||||
|
||||
Ash.Changeset.force_change_attribute(
|
||||
changeset,
|
||||
|
||||
Reference in New Issue
Block a user