Add the update action and the form for Publisher.
This commit is contained in:
@@ -41,7 +41,7 @@ defmodule DecentralisedBookIndex.Metadata.Publisher do
|
|||||||
end
|
end
|
||||||
|
|
||||||
actions do
|
actions do
|
||||||
defaults [:read, :update, :destroy]
|
defaults [:read, :destroy]
|
||||||
|
|
||||||
create :create do
|
create :create do
|
||||||
primary? true
|
primary? true
|
||||||
@@ -69,6 +69,11 @@ defmodule DecentralisedBookIndex.Metadata.Publisher do
|
|||||||
pagination offset?: true, default_limit: 10
|
pagination offset?: true, default_limit: 10
|
||||||
end
|
end
|
||||||
|
|
||||||
|
update :update do
|
||||||
|
primary? true
|
||||||
|
accept [:name]
|
||||||
|
end
|
||||||
|
|
||||||
update :sync do
|
update :sync do
|
||||||
accept [:name, :inserted_at, :updated_at, :dbi_server_id]
|
accept [:name, :inserted_at, :updated_at, :dbi_server_id]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ defmodule DecentralisedBookIndexWeb.PublisherLive.FormComponent do
|
|||||||
<.input field={@form[:name]} type="text" label="Name" />
|
<.input field={@form[:name]} type="text" label="Name" />
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= if @form.source.type == :update do %>
|
<%= if @form.source.type == :update do %>
|
||||||
|
<.input field={@form[:name]} type="text" label="Name" />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<:actions>
|
<:actions>
|
||||||
|
|||||||
Reference in New Issue
Block a user