Add the search action for DBIServer.

dev
KKlochko 2 months ago
parent 5e478b7e6d
commit 97633869df

@ -100,6 +100,7 @@ defmodule DecentralisedBookIndex.Metadata do
define :create_dbi_server, action: :create
define :list_dbi_server, action: :read
define :get_dbi_server_by_id, args: [:id], action: :by_id
define :search_dbi_server, action: :search, args: [:name]
define :update_dbi_server, action: :update
define :destroy_dbi_server, action: :destroy
end

@ -30,6 +30,17 @@ defmodule DecentralisedBookIndex.Metadata.DBIServer do
get? true
filter expr(id == ^arg(:id))
end
read :search do
argument :name, :ci_string do
constraints allow_empty?: true
default ""
end
filter expr(contains(name, ^arg(:name)))
pagination offset?: true, default_limit: 10
end
end
policies do
@ -51,7 +62,10 @@ defmodule DecentralisedBookIndex.Metadata.DBIServer do
public? true
end
timestamps()
timestamps do
writable? true
public? true
end
end
relationships do

Loading…
Cancel
Save