@ -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))
read :search do
argument :name, :ci_string do
constraints allow_empty?: true
default ""
filter expr(contains(name, ^arg(:name)))
pagination offset?: true, default_limit: 10
policies do
@ -51,7 +62,10 @@ defmodule DecentralisedBookIndex.Metadata.DBIServer do
public? true
timestamps()
timestamps do
writable? true
relationships do